|
|
|
|
|
by valarauca1
4057 days ago
|
|
I understand the anger but at the same time I don't. Overall unwrap() isn't good. Really it should be replaced by TODO WRITE ERROR HANDLING in 90% of its cases. That being said there are still good uses for it. The main _safe_ use for unwrap() I find is when dealing with an iterator of Results/Options (which seems to happen a lot). The pattern: .filter( |x| x.is_some() )
.map( |x| x.unwrap() )
Is safe, and I really don't know a more eloquent method of handling these operations. |
|