From 08596e55a3e71f2fd636494aaa232e1cf476e4ac Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Thu, 4 Apr 2019 21:35:11 +0200 Subject: Handle Some as in upstream grammar --- iter_patterns/src/lib.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'iter_patterns/src') 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, } } }; -- cgit v1.2.3