chiark
/
gitweb
/
~ianmdlvl
/
otter.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8b69a17
)
utils: matches_doesnot syntax update
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Sun, 7 Mar 2021 22:24:22 +0000
(22:24 +0000)
committer
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Sun, 7 Mar 2021 22:24:22 +0000
(22:24 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/utils.rs
patch
|
blob
|
history
diff --git
a/src/utils.rs
b/src/utils.rs
index 6169c1629a92a7998f69a4a339df26c80f0b5e84..165b9a27b15d85ddbce95c97c250787c9aedd70f 100644
(file)
--- a/
src/utils.rs
+++ b/
src/utils.rs
@@
-355,12
+355,19
@@
impl<T,U,E,F> IteratorExt<U,E,F> for T where
#[macro_export]
macro_rules! matches_doesnot {
- ($v:expr; $y:pat, ! $n:pat) => { match $v { $y => true, $n => false } }
+ ($v:expr, = $y:pat, ! $n:pat $(,)?) =>
+ { match $v { $y => true, $n => false } }
}
#[test]
fn matches_doesnot_test() {
- assert!( matches_doesnot!( Some(42); Some(_), ! None) );
+ assert!(
+ matches_doesnot!(
+ Some(42),
+ = Some(_),
+ ! None
+ )
+ );
}
#[macro_export]