1 // https://github.com/SimonSapin/rust-std-candidates/issues/12 2 #[macro_use(matches)] extern crate matches; 3 4 #[test] matches_works()5fn matches_works() { 6 let foo = Some("-12"); 7 assert!(matches!(foo, Some(bar) if 8 matches!(bar.as_bytes()[0], b'+' | b'-') && 9 matches!(bar.as_bytes()[1], b'0'...b'9') 10 )); 11 } 12