DEV Community

Discussion on: Killing unwrap()

Collapse
 
jeikabu profile image
jeikabu • Edited

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.

Collapse
 
dmerejkowsky profile image
Dimitri Merejkowsky

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

I'll update the article