From ede1b11741f2758effaf110dca52f31e39503049 Mon Sep 17 00:00:00 2001 From: Edwin Cheng Date: Thu, 31 Dec 2020 02:38:40 +0800 Subject: Remove unused clones in mbe --- crates/mbe/src/lib.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'crates') diff --git a/crates/mbe/src/lib.rs b/crates/mbe/src/lib.rs index 7878faaa4..b3472879d 100644 --- a/crates/mbe/src/lib.rs +++ b/crates/mbe/src/lib.rs @@ -217,18 +217,14 @@ impl MacroRules { impl Rule { fn parse(src: &mut TtIter) -> Result { - let mut lhs = src + let lhs = src .expect_subtree() - .map_err(|()| ParseError::Expected("expected subtree".to_string()))? - .clone(); - lhs.delimiter = None; + .map_err(|()| ParseError::Expected("expected subtree".to_string()))?; src.expect_char('=').map_err(|()| ParseError::Expected("expected `=`".to_string()))?; src.expect_char('>').map_err(|()| ParseError::Expected("expected `>`".to_string()))?; - let mut rhs = src + let rhs = src .expect_subtree() - .map_err(|()| ParseError::Expected("expected subtree".to_string()))? - .clone(); - rhs.delimiter = None; + .map_err(|()| ParseError::Expected("expected subtree".to_string()))?; let lhs = MetaTemplate { tokens: parse_pattern(&lhs), delimiter: None }; let rhs = MetaTemplate { tokens: parse_template(&rhs), delimiter: None }; -- cgit v1.2.3