mine (not js, but rust):
send_method::<bool, C>(
self.client,
&self.token,
"answerInlineQuery",
None,
serde_json::to_vec(&self).unwrap(),
)
.map(|_| ())
it's easy to understand that this snippet maps the response of the request from bool to () (aka unit), but why does it map the response? the comment next to this code explains:
// Only `true` is returned on success
so there's nothing to do with the response, but users of my library would have to add this map if i didn't (for reasons i could explain, but they don't matter for our topic). Could the code itself explain the reasoning? I don't think so
That's an exception
You has docblock for such case
Yeah easy xd
Обсуждают сегодня