summaryrefslogtreecommitdiff
path: root/iter_patterns
diff options
context:
space:
mode:
authorNadrieril2019-03-27 00:22:39 +0100
committerNadrieril2019-03-27 00:22:39 +0100
commit108c35242884b9cb5e3988e406f7983404cdf315 (patch)
treefbdbd144c5582e2b7fea3b8663ea0f87306044ca /iter_patterns
parent173e0eb15b33342ec7c3523be0f913a962e7b85a (diff)
Manually rustfmt like a nazi
Diffstat (limited to '')
-rw-r--r--iter_patterns/src/lib.rs30
1 files changed, 23 insertions, 7 deletions
diff --git a/iter_patterns/src/lib.rs b/iter_patterns/src/lib.rs
index 5395755..10679aa 100644
--- a/iter_patterns/src/lib.rs
+++ b/iter_patterns/src/lib.rs
@@ -26,19 +26,31 @@
macro_rules! destructure_iter {
// Variable length pattern
(@match_forwards, $iter:expr, ($body:expr), $x:ident.., $($rest:tt)*) => {
- $crate::destructure_iter!(@match_backwards, $iter, ({
- let $x = $iter;
- $body
- }), $($rest)*)
+ $crate::destructure_iter!(@match_backwards,
+ $iter,
+ ({
+ let $x = $iter;
+ $body
+ }),
+ $($rest)*
+ )
};
// Variable length pattern without a binder
(@match_forwards, $iter:expr, ($body:expr), .., $($rest:tt)*) => {
- $crate::destructure_iter!(@match_backwards, $iter, ($body), $($rest)*)
+ $crate::destructure_iter!(@match_backwards,
+ $iter,
+ ($body),
+ $($rest)*
+ )
};
// Single item pattern
(@match_forwards, $iter:expr, ($body:expr), $x:pat, $($rest:tt)*) => {
if let Some($x) = $iter.next() {
- $crate::destructure_iter!(@match_forwards, $iter, ($body), $($rest)*)
+ $crate::destructure_iter!(@match_forwards,
+ $iter,
+ ($body),
+ $($rest)*
+ )
} else {
None
}
@@ -71,7 +83,11 @@ macro_rules! destructure_iter {
{
#[allow(unused_mut)]
let mut iter = $iter;
- $crate::destructure_iter!(@match_forwards, iter, (Some($body)), $($args)*,)
+ $crate::destructure_iter!(@match_forwards,
+ iter,
+ (Some($body)),
+ $($args)*,
+ )
}
};
}