@jalcine I’ll do the former mostly to change types, but even then it’s rare. I kind of enjoy naming and organizing errors so the ? notation nudges me in that direction, and I appreciate that in addition to the readability gains
Conversation
Notices
-
Embed this notice
esmevane, sorry (ironchamber@mastodon.esmevane.com)'s status on Sunday, 26-Nov-2023 04:22:46 JST esmevane, sorry -
Embed this notice
✌🏿✍🏿 (jalcine@todon.eu)'s status on Sunday, 26-Nov-2023 04:22:48 JST ✌🏿✍🏿 people writing #RustLang:
method #1: result.and_then(|()| another_thing_that_results()).and_then(|()| yet_another_thing_that_results())
method #2: result?; another_thing_that_results?; yet_another_thing_that_results? Ok(())
I tend to catch myself doing the first form because of #Elixir but now I'm slowly replacing things with method #2 because it's way more readable
how do people tend to go about this?
the latter also seems a lot easier to log?
-
Embed this notice