aboutsummaryrefslogtreecommitdiff
path: root/crates/mbe/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/mbe/src')
-rw-r--r--crates/mbe/src/benchmark.rs5
-rw-r--r--crates/mbe/src/parser.rs2
2 files changed, 3 insertions, 4 deletions
diff --git a/crates/mbe/src/benchmark.rs b/crates/mbe/src/benchmark.rs
index bd8ea6452..ba814a2e1 100644
--- a/crates/mbe/src/benchmark.rs
+++ b/crates/mbe/src/benchmark.rs
@@ -165,7 +165,7 @@ fn invocation_fixtures(rules: &FxHashMap<String, MacroRules>) -> Vec<(String, tt
165 } 165 }
166 Separator::Puncts(puncts) => { 166 Separator::Puncts(puncts) => {
167 for it in puncts { 167 for it in puncts {
168 parent.token_trees.push(tt::Leaf::Punct(it.clone()).into()) 168 parent.token_trees.push(tt::Leaf::Punct(*it).into())
169 } 169 }
170 } 170 }
171 }; 171 };
@@ -174,8 +174,7 @@ fn invocation_fixtures(rules: &FxHashMap<String, MacroRules>) -> Vec<(String, tt
174 } 174 }
175 } 175 }
176 Op::Subtree { tokens, delimiter } => { 176 Op::Subtree { tokens, delimiter } => {
177 let mut subtree = 177 let mut subtree = tt::Subtree { delimiter: *delimiter, token_trees: Vec::new() };
178 tt::Subtree { delimiter: delimiter.clone(), token_trees: Vec::new() };
179 tokens.iter().for_each(|it| { 178 tokens.iter().for_each(|it| {
180 collect_from_op(it, &mut subtree, seed); 179 collect_from_op(it, &mut subtree, seed);
181 }); 180 });
diff --git a/crates/mbe/src/parser.rs b/crates/mbe/src/parser.rs
index 8671322e1..7b5b8ec16 100644
--- a/crates/mbe/src/parser.rs
+++ b/crates/mbe/src/parser.rs
@@ -262,7 +262,7 @@ fn parse_repeat(src: &mut TtIter) -> Result<(Option<Separator>, RepeatKind), Par
262 if puncts.len() == 3 { 262 if puncts.len() == 3 {
263 return Err(ParseError::InvalidRepeat); 263 return Err(ParseError::InvalidRepeat);
264 } 264 }
265 puncts.push(punct.clone()) 265 puncts.push(*punct)
266 } 266 }
267 _ => return Err(ParseError::InvalidRepeat), 267 _ => return Err(ParseError::InvalidRepeat),
268 } 268 }