aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_mbe/src/tt_cursor.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_mbe/src/tt_cursor.rs')
-rw-r--r--crates/ra_mbe/src/tt_cursor.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/crates/ra_mbe/src/tt_cursor.rs b/crates/ra_mbe/src/tt_cursor.rs
index 503c77ef3..8e360ce0f 100644
--- a/crates/ra_mbe/src/tt_cursor.rs
+++ b/crates/ra_mbe/src/tt_cursor.rs
@@ -171,14 +171,14 @@ impl<'a> TtCursor<'a> {
171 } 171 }
172 172
173 fn eat_punct3(&mut self, p: &tt::Punct) -> Option<SmallVec<[tt::Punct; 3]>> { 173 fn eat_punct3(&mut self, p: &tt::Punct) -> Option<SmallVec<[tt::Punct; 3]>> {
174 let sec = self.eat_punct()?.clone(); 174 let sec = *self.eat_punct()?;
175 let third = self.eat_punct()?.clone(); 175 let third = *self.eat_punct()?;
176 Some(smallvec![p.clone(), sec, third]) 176 Some(smallvec![*p, sec, third])
177 } 177 }
178 178
179 fn eat_punct2(&mut self, p: &tt::Punct) -> Option<SmallVec<[tt::Punct; 3]>> { 179 fn eat_punct2(&mut self, p: &tt::Punct) -> Option<SmallVec<[tt::Punct; 3]>> {
180 let sec = self.eat_punct()?.clone(); 180 let sec = *self.eat_punct()?;
181 Some(smallvec![p.clone(), sec]) 181 Some(smallvec![*p, sec])
182 } 182 }
183 183
184 fn eat_multi_char_punct<'b, I>( 184 fn eat_multi_char_punct<'b, I>(
@@ -251,7 +251,7 @@ impl<'a> TtCursor<'a> {
251 // So we by pass that check here. 251 // So we by pass that check here.
252 let mut peekable = TokenPeek::new(self.subtree.token_trees[self.pos..].iter()); 252 let mut peekable = TokenPeek::new(self.subtree.token_trees[self.pos..].iter());
253 let puncts = self.eat_multi_char_punct(punct, &mut peekable); 253 let puncts = self.eat_multi_char_punct(punct, &mut peekable);
254 let puncts = puncts.unwrap_or_else(|| smallvec![punct.clone()]); 254 let puncts = puncts.unwrap_or_else(|| smallvec![*punct]);
255 255
256 Some(crate::Separator::Puncts(puncts)) 256 Some(crate::Separator::Puncts(puncts))
257 } 257 }