What is the primary difference between panic!() and Result?
Does the following successfully execute?
fn main() { panic!("{string}", string = ":(") }
Why does the following code fail to execute?
fn none() -> Option< char > { None } fn main() { println!("{:?}", none().unwrap()) }
Fill in the blank in the following function with an appropriate type:
fn fail_result() -> Result < i32, > { Err(12.346) }
What is the printed output of the code below?
fn result_to_option(opt: Result < i32, char >) -> Option< i32 > { let new_option = Some(opt.ok()?); new_option } fn main() { let res = Err('a'); println!("{:?}", result_to_option(res)) }