Macro choice::choice_at [−][src]
Syntactic sugar for destructuring a Choice
between multiple types.
See also choice_unreachable
.
Example
use choice::{Choice, choice, choice_at, choice_unreachable}; let c: choice![u8, char] = Choice::new('2').or(); match c { choice_at!(0, v) => { panic!("Unexpected match: {}", v); } choice_at!(1, v) => { assert_eq!(v, '2'); } choice_unreachable!(2) => { unreachable!(); } }