Похожие чаты

For example, a very small snippet from a library of

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

3 ответов

1 просмотр

That's an exception

You has docblock for such case

Yeah easy xd

Похожие вопросы

Обсуждают сегодня

A couple thoughts from a random internet stranger: 1. If you want this project to gain traction you cannot keep being negative. If I just came here after finding out about Kd...
Eric Wild
22
подскажите пожалуйста, как мне освободить результат записанный в переменную result? в чем проблема подскажите если МОЖЕТЕ?
Михаил Helper
28
есть тут кто-то , кто только начал изучать си? если проходите курс на степике или как-то сами изучаете, пишите, может, скооперируемся?..
Eule
25
Скажите, тут нет проблемы? IMyInterface1 = interface function GetInterface2: IInterface2; ... function TMyInterface.GetInterface2: IInterface2; begin Result := TI...
Ruslan aka DUDE
18
возможно для форматирования TimeStampZ нужен другой механизм, не?
Роман Лях (rgreat)
13
Bhai mera Wazirx Account locked kr diya hei inhone to use unlock kese kru ?? Kisi ke ye problem aayi aur solve ho gayi hei to batao ?
Govind Jarwal
33
Hello guys I was wondering whether if it is OK to download the monero block chain without using tor?? Does that effect the privacy of the wallet I want to connect the monero b...
Jackisow
12
Добрый день. Абракадабра в 12-й студии ввела новый тип поля БД TSQLTimeStampOffset, использую в постгресе timestampz и вот с 12-й версии начались чудеса! До этого поля times...
Delphi Photo
9
Коллеги, здравствуйте! А можно узнать ваше мнение относительно Wolfram Mathematica vs Julia? Просто у меня стоит выбор между тем, чтобы продолжить преподавать Wolfram Mathemat...
Илья Гаража
10
Hello, I am Ashamer from UNCX, a DeFi service provider. I am contacting you to ask if there is any room for a potential collaboration. Is there anyone whom I can potentially t...
Ashamer
19
Карта сайта