« first day (3091 days earlier)      last day (391 days later) » 

11:55 PM
Hey yall, is there a slick trick to call a function on something in an Option, but replace that Option with None if the call fails? The best I got was if let Some(Err(_)) = opt_thing.as_ref().map(Thing::do_stuff) { opt_thing = None; } but I'm curious if there's a better way. playground link
 

« first day (3091 days earlier)      last day (391 days later) »