
A Practical Analysis of Rust's Concurrency Story - furcyd
https://arxiv.org/abs/1904.12210
======
ordu
_> we found that it took some effort to remove these unwraps and replace them
with match statements or the equivalent._

You may choose to not use match expression. It can be as simple as:

    
    
        fn get_val() -> i64 {
            function_returning_result().unwrap_or(-1)
        }
    

Or if println! there is really needed, then instead of unwrap_or is possible
to use unwrap_or_else with a lambda:

    
    
        fn get_val() -> i64 {
            function_returning_result()
            .unwrap_or_else(|e| {
                println!("Error occured! {:?}", e);
                -1
            })
        }

