`map_or`のようにクロージャ引数が1つのみの場合は「クロージャが最後」の原則で良いけど、`Result::map_or_else`の場合は2つともクロージャ引数なのだよね……。

私の覚え方としては、`*_or`のように前置詞や接続表現で終わる名前の関数については第1引数までそのまま英語として読んだときに自然に繋がる順番を選ぶ、という方針でやっている。例えば`map_or(false, |_| …)`は"map or false"という一塊りの処理として捉える。ちょうど`map_or_default()`が`map_or(Default::default(), …)`であるのと同様に

0

If you have a fediverse account, you can quote this note from your own instance. Search https://fedibird.com/users/tesaguri/statuses/115924348146150390 on your instance and quote it. (Note that quoting is not supported in Mastodon.)