no_error

Function no_error 

Source
pub fn no_error<T>(error: !) -> T
Expand description

Provides an idiomatic way to convert a Result<T, !> into T, via

fn some_computation() -> Result<&'static str, !> { Ok("this computation does not fail") }
println!("{}", some_computation().unwrap_or_else(no_error));