7099: Remove unused clones in mbe r=edwin0cheng a=edwin0cheng

bors r+

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
This commit is contained in:
bors[bot] 2020-12-30 19:10:56 +00:00 committed by GitHub
commit bed7be9ed9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -217,18 +217,14 @@ impl MacroRules {
impl Rule {
fn parse(src: &mut TtIter) -> Result<Rule, ParseError> {
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 };