diff options
Diffstat (limited to 'crates/mbe/src')
-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 }; |