Macro let_scan

Source
macro_rules! let_scan {
    ($input:expr; ($($pattern:tt)*)) => { ... };
}
Expand description

Scans the provided input, using the specified pattern. All values are bound directly to local variables.

Note that this macro only supports a single pattern.

See also: Pattern Syntax, scan!.

§Examples

let input = "10¥, うまい棒";
let_scan!(input; (let cost: u32, "¥,", let product: Word));
println!("One {} costs {}¥.", product, cost);

§Panics

Panics if the pattern fails to match.