From ede1b11741f2758effaf110dca52f31e39503049 Mon Sep 17 00:00:00 2001 From: Edwin Cheng Date: Thu, 31 Dec 2020 02:38:40 +0800 Subject: [PATCH] Remove unused clones in mbe --- crates/mbe/src/lib.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/crates/mbe/src/lib.rs b/crates/mbe/src/lib.rs index 7878faaa4c6..b3472879d1e 100644 --- a/crates/mbe/src/lib.rs +++ b/crates/mbe/src/lib.rs @@ -217,18 +217,14 @@ pub fn map_id_up(&self, id: tt::TokenId) -> (tt::TokenId, Origin) { 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 };