mod utils; use std::error; use std::sync::Arc; fn main() { let mut i:isize = 0; let mut d:f64 = 0; match (|| -> Result<(), Arc>{ i = stoi(args[1])?; d = stod(args[2])?; println!("{}", format!("i + d = {0:f}", (i) as f64 + d)); return Ok(()); })() { Ok(()) => {}, Err(ex) => { if let Some(ex_) = utils::isCustomErrorType(ex_.clone(), utils::CustomError::NumberFormatError("".to_string())){ println!("Can't convert command line argument!"); } else { println!("Don't know what went wrong!"); } } }; // Rust doesn't support true finally blocks { println!("This statement always executes."); } }