diff options
Diffstat (limited to 'crates/ra_mbe/src')
-rw-r--r-- | crates/ra_mbe/src/lib.rs | 6 | ||||
-rw-r--r-- | crates/ra_mbe/src/mbe_expander/matcher.rs | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/crates/ra_mbe/src/lib.rs b/crates/ra_mbe/src/lib.rs index 9c450eaba..dec7ba22e 100644 --- a/crates/ra_mbe/src/lib.rs +++ b/crates/ra_mbe/src/lib.rs | |||
@@ -9,6 +9,9 @@ mod syntax_bridge; | |||
9 | mod tt_iter; | 9 | mod tt_iter; |
10 | mod subtree_source; | 10 | mod subtree_source; |
11 | 11 | ||
12 | #[cfg(test)] | ||
13 | mod tests; | ||
14 | |||
12 | pub use tt::{Delimiter, Punct}; | 15 | pub use tt::{Delimiter, Punct}; |
13 | 16 | ||
14 | use crate::{ | 17 | use crate::{ |
@@ -273,6 +276,3 @@ impl<T: Default> From<Result<T, ExpandError>> for ExpandResult<T> { | |||
273 | .map_or_else(|e| ExpandResult(Default::default(), Some(e)), |it| ExpandResult(it, None)) | 276 | .map_or_else(|e| ExpandResult(Default::default(), Some(e)), |it| ExpandResult(it, None)) |
274 | } | 277 | } |
275 | } | 278 | } |
276 | |||
277 | #[cfg(test)] | ||
278 | mod tests; | ||
diff --git a/crates/ra_mbe/src/mbe_expander/matcher.rs b/crates/ra_mbe/src/mbe_expander/matcher.rs index 78f9efa1b..f9e515b81 100644 --- a/crates/ra_mbe/src/mbe_expander/matcher.rs +++ b/crates/ra_mbe/src/mbe_expander/matcher.rs | |||
@@ -260,7 +260,7 @@ impl<'a> TtIter<'a> { | |||
260 | | ('|', '=', None) | 260 | | ('|', '=', None) |
261 | | ('|', '|', None) => { | 261 | | ('|', '|', None) => { |
262 | let tt2 = self.next().unwrap().clone(); | 262 | let tt2 = self.next().unwrap().clone(); |
263 | Ok(tt::Subtree { delimiter: None, token_trees: vec![tt.clone(), tt2] }.into()) | 263 | Ok(tt::Subtree { delimiter: None, token_trees: vec![tt, tt2] }.into()) |
264 | } | 264 | } |
265 | _ => Ok(tt), | 265 | _ => Ok(tt), |
266 | } | 266 | } |