Macro text_io::try_scan
[−]
[src]
macro_rules! try_scan { ($pattern:expr, $($arg:expr),*) => { ... }; ($input:expr => $pattern:expr, $($arg:expr),*) => { ... }; (@question_mark: $($e:tt)+) => { ... }; (@unwrap: $($e:tt)+) => { ... }; (@impl $action:tt; $input:expr => $pattern:expr, $($arg:expr),*) => { ... }; }
fn parser() -> Result<i32, Box<Error>> { let i: i32; let text = "The answer is 42!"; try_scan!(text.bytes() => "The answer is {}!", i); assert_eq!(i, 1); Ok(i) }