diff options
| author | Mark-Simulacrum <mark.simulacrum@gmail.com> | 2016-11-07 19:17:17 -0700 |
|---|---|---|
| committer | Mark-Simulacrum <mark.simulacrum@gmail.com> | 2016-11-12 06:42:40 -0700 |
| commit | c9e6089d29cd3263897d91e12519b79ba8721f85 (patch) | |
| tree | 3c224f4e1e019a6493b184dfae8364c42c7f7e24 /src/libsyntax/ext | |
| parent | 7221b07a075aacad2b0d5962568000ba7defe5f9 (diff) | |
| download | rust-c9e6089d29cd3263897d91e12519b79ba8721f85.tar.gz rust-c9e6089d29cd3263897d91e12519b79ba8721f85.zip | |
Refactor to extending from a drain instead of while looping.
Diffstat (limited to 'src/libsyntax/ext')
| -rw-r--r-- | src/libsyntax/ext/tt/macro_parser.rs | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/libsyntax/ext/tt/macro_parser.rs b/src/libsyntax/ext/tt/macro_parser.rs index 42c71d93a28..5f976336ccd 100644 --- a/src/libsyntax/ext/tt/macro_parser.rs +++ b/src/libsyntax/ext/tt/macro_parser.rs @@ -453,9 +453,7 @@ pub fn parse(sess: &ParseSess, rdr: TtReader, ms: &[TokenTree]) -> NamedParseRes return Failure(parser.span, parser.token); } else if !next_eis.is_empty() { /* Now process the next token */ - while !next_eis.is_empty() { - cur_eis.push(next_eis.pop().unwrap()); - } + cur_eis.extend(next_eis.drain(..)); parser.bump(); } else /* bb_eis.len() == 1 */ { let mut ei = bb_eis.pop().unwrap(); |
