summaryrefslogtreecommitdiff
path: root/iter_patterns
diff options
context:
space:
mode:
authorNadrieril Feneanar2019-04-04 23:51:46 +0200
committerGitHub2019-04-04 23:51:46 +0200
commita9f4e9b10196d75e674d95160955360d388a772b (patch)
tree20d869202eadc1193e449d3b3320f9b1d89ae578 /iter_patterns
parent7336787af41adc4dfe650f7c7f10f9c7c3c011db (diff)
parent74eb88c42d938672137771fab33ef0118903b5e1 (diff)
Merge pull request #42 from Nadrieril/move-to-upstream-grammar
Move to upstream grammar
Diffstat (limited to '')
-rw-r--r--iter_patterns/src/lib.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/iter_patterns/src/lib.rs b/iter_patterns/src/lib.rs
index a4be783..6d3649e 100644
--- a/iter_patterns/src/lib.rs
+++ b/iter_patterns/src/lib.rs
@@ -60,23 +60,23 @@ macro_rules! destructure_iter {
};
// Single item pattern
(@match_forwards, $iter:expr, ($body:expr), $x:pat, $($rest:tt)*) => {
- if let Some($x) = $iter.next() {
+ if let std::option::Option::Some($x) = $iter.next() {
$crate::destructure_iter!(@match_forwards,
$iter,
($body),
$($rest)*
)
} else {
- None
+ std::option::Option::None
}
};
// Single item pattern after a variable length one: declare reversed and take from the end
(@match_backwards, $iter:expr, ($body:expr), $x:pat, $($rest:tt)*) => {
$crate::destructure_iter!(@match_backwards, $iter, (
- if let Some($x) = $iter.next_back() {
+ if let std::option::Option::Some($x) = $iter.next_back() {
$body
} else {
- None
+ std::option::Option::None
}
), $($rest)*)
};
@@ -84,7 +84,7 @@ macro_rules! destructure_iter {
// Check no elements remain
(@match_forwards, $iter:expr, ($body:expr) $(,)*) => {
if $iter.next().is_some() {
- None
+ std::option::Option::None
} else {
$body
}
@@ -100,7 +100,7 @@ macro_rules! destructure_iter {
let mut iter = $iter;
$crate::destructure_iter!(@match_forwards,
iter,
- (Some($body)),
+ (std::option::Option::Some($body)),
$($args)*,
)
}
@@ -216,7 +216,7 @@ macro_rules! match_vec {
$crate::destructure_iter!(iter; [$($args)*] => $body)
}
)*
- _ => None,
+ _ => std::option::Option::None,
}
}
};