You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
// https://github.com/SimonSapin/rust-std-candidates/issues/12
|
|
#[macro_use(matches)] extern crate matches;
|
|
|
|
#[test]
|
|
fn matches_works() {
|
|
let foo = Some("-12");
|
|
assert!(matches!(foo, Some(bar) if
|
|
matches!(bar.as_bytes()[0], b'+' | b'-') &&
|
|
matches!(bar.as_bytes()[1], b'0'...b'9')
|
|
));
|
|
}
|