diff options
author | Edwin Cheng <[email protected]> | 2020-12-30 18:38:40 +0000 |
---|---|---|
committer | Edwin Cheng <[email protected]> | 2020-12-30 18:58:41 +0000 |
commit | ede1b11741f2758effaf110dca52f31e39503049 (patch) | |
tree | 764d05d32107db7968bd867f794265d10448eff8 /crates | |
parent | 848e817f603ed12e065bc3057d12e04b481fb5bb (diff) |
Remove unused clones in mbe
Diffstat (limited to 'crates')
-rw-r--r-- | crates/mbe/src/lib.rs | 12 |
1 files changed, 4 insertions, 8 deletions
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 { | |||
217 | 217 | ||
218 | impl Rule { | 218 | impl Rule { |
219 | fn parse(src: &mut TtIter) -> Result<Rule, ParseError> { | 219 | fn parse(src: &mut TtIter) -> Result<Rule, ParseError> { |
220 | let mut lhs = src | 220 | let lhs = src |
221 | .expect_subtree() | 221 | .expect_subtree() |
222 | .map_err(|()| ParseError::Expected("expected subtree".to_string()))? | 222 | .map_err(|()| ParseError::Expected("expected subtree".to_string()))?; |
223 | .clone(); | ||
224 | lhs.delimiter = None; | ||
225 | src.expect_char('=').map_err(|()| ParseError::Expected("expected `=`".to_string()))?; | 223 | src.expect_char('=').map_err(|()| ParseError::Expected("expected `=`".to_string()))?; |
226 | src.expect_char('>').map_err(|()| ParseError::Expected("expected `>`".to_string()))?; | 224 | src.expect_char('>').map_err(|()| ParseError::Expected("expected `>`".to_string()))?; |
227 | let mut rhs = src | 225 | let rhs = src |
228 | .expect_subtree() | 226 | .expect_subtree() |
229 | .map_err(|()| ParseError::Expected("expected subtree".to_string()))? | 227 | .map_err(|()| ParseError::Expected("expected subtree".to_string()))?; |
230 | .clone(); | ||
231 | rhs.delimiter = None; | ||
232 | 228 | ||
233 | let lhs = MetaTemplate { tokens: parse_pattern(&lhs), delimiter: None }; | 229 | let lhs = MetaTemplate { tokens: parse_pattern(&lhs), delimiter: None }; |
234 | let rhs = MetaTemplate { tokens: parse_template(&rhs), delimiter: None }; | 230 | let rhs = MetaTemplate { tokens: parse_template(&rhs), delimiter: None }; |