DEV Community

Discussion on: Killing unwrap()

jeikabu profile image
jeikabu • Edited on

I'm definitely guilty of excessive unwrap()-ing. It's just so easy to do and it feels like an assert().
And good job pointing out the combinators on Result and Option. Just this weekend I realized I had re-invented map() (poorly) and went back and re-factored some code.
One thing I found really helpful is main and tests being able to -> Result<>. Makes it a lot easier to move "correct" code using ? between tests/lib/bin.

dmerejkowsky profile image
Dimitri Merejkowsky Author

Did not know about tests being able to return Result<>, thanks for pointing that out.

I'll update the article