#![allow(dead_code, deprecated, unused_variables, unused_mut)] fn stringify(x: u32) -> String { format!("error code: {x}") } fn main() { let x: Result = Ok(2); assert_eq!(x.map_err(stringify), Ok(2)); let x: Result = Err(13); assert_eq!(x.map_err(stringify), Err("error code: 13".to_string())); }