aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_mbe/src/mbe_expander/matcher.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_mbe/src/mbe_expander/matcher.rs')
-rw-r--r--crates/ra_mbe/src/mbe_expander/matcher.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_mbe/src/mbe_expander/matcher.rs b/crates/ra_mbe/src/mbe_expander/matcher.rs
index 33b9d483d..3f5136478 100644
--- a/crates/ra_mbe/src/mbe_expander/matcher.rs
+++ b/crates/ra_mbe/src/mbe_expander/matcher.rs
@@ -16,7 +16,7 @@ impl Bindings {
16 fn push_optional(&mut self, name: &SmolStr) { 16 fn push_optional(&mut self, name: &SmolStr) {
17 // FIXME: Do we have a better way to represent an empty token ? 17 // FIXME: Do we have a better way to represent an empty token ?
18 // Insert an empty subtree for empty token 18 // Insert an empty subtree for empty token
19 let tt = tt::Subtree { delimiter: tt::Delimiter::None, token_trees: vec![] }.into(); 19 let tt = tt::Subtree::default().into();
20 self.inner.insert(name.clone(), Binding::Fragment(Fragment::Tokens(tt))); 20 self.inner.insert(name.clone(), Binding::Fragment(Fragment::Tokens(tt)));
21 } 21 }
22 22
@@ -65,7 +65,7 @@ macro_rules! bail {
65} 65}
66 66
67pub(super) fn match_(pattern: &tt::Subtree, src: &tt::Subtree) -> Result<Bindings, ExpandError> { 67pub(super) fn match_(pattern: &tt::Subtree, src: &tt::Subtree) -> Result<Bindings, ExpandError> {
68 assert!(pattern.delimiter == tt::Delimiter::None); 68 assert!(pattern.delimiter == None);
69 69
70 let mut res = Bindings::default(); 70 let mut res = Bindings::default();
71 let mut src = TtIter::new(src); 71 let mut src = TtIter::new(src);
@@ -210,7 +210,7 @@ impl<'a> TtIter<'a> {
210 0 => Err(()), 210 0 => Err(()),
211 1 => Ok(res[0].clone()), 211 1 => Ok(res[0].clone()),
212 _ => Ok(tt::TokenTree::Subtree(tt::Subtree { 212 _ => Ok(tt::TokenTree::Subtree(tt::Subtree {
213 delimiter: tt::Delimiter::None, 213 delimiter: None,
214 token_trees: res.into_iter().cloned().collect(), 214 token_trees: res.into_iter().cloned().collect(),
215 })), 215 })),
216 } 216 }