From 048dad8c2e86006e53b3a134279729efb28b9e32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Wed, 17 Mar 2021 01:56:31 +0100 Subject: don't clone types that are copy (clippy::clone_on_copy) --- crates/mbe/src/benchmark.rs | 5 ++--- crates/mbe/src/parser.rs | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'crates/mbe/src') 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) -> Vec<(String, tt } Separator::Puncts(puncts) => { for it in puncts { - parent.token_trees.push(tt::Leaf::Punct(it.clone()).into()) + parent.token_trees.push(tt::Leaf::Punct(*it).into()) } } }; @@ -174,8 +174,7 @@ fn invocation_fixtures(rules: &FxHashMap) -> Vec<(String, tt } } Op::Subtree { tokens, delimiter } => { - let mut subtree = - tt::Subtree { delimiter: delimiter.clone(), token_trees: Vec::new() }; + let mut subtree = tt::Subtree { delimiter: *delimiter, token_trees: Vec::new() }; tokens.iter().for_each(|it| { collect_from_op(it, &mut subtree, seed); }); 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, RepeatKind), Par if puncts.len() == 3 { return Err(ParseError::InvalidRepeat); } - puncts.push(punct.clone()) + puncts.push(*punct) } _ => return Err(ParseError::InvalidRepeat), } -- cgit v1.2.3