diff options
| author | Tyler Mandry <tmandry@gmail.com> | 2019-10-14 17:52:35 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-10-14 17:52:35 -0700 |
| commit | 6d28ed1ae6c3f44f03e30e4884d6701e36744246 (patch) | |
| tree | a0d427b499474c674bec40a57bb905ddbc64556c /src/libsyntax/parse | |
| parent | a9a4d4033d3d5b4d8ad2593088196114f7254eda (diff) | |
| parent | 18b48bf4b9158611cd77bd5fae123a5fa3f052a5 (diff) | |
| download | rust-6d28ed1ae6c3f44f03e30e4884d6701e36744246.tar.gz rust-6d28ed1ae6c3f44f03e30e4884d6701e36744246.zip | |
Rollup merge of #65261 - nnethercote:rm-Option-from-TokenStream, r=petrochenkov
Remove `Option` from `TokenStream` A code simplification. r? @petrochenkov
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/attr.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/libsyntax/parse/attr.rs b/src/libsyntax/parse/attr.rs index e74f3045db8..0963efcfc8a 100644 --- a/src/libsyntax/parse/attr.rs +++ b/src/libsyntax/parse/attr.rs @@ -203,7 +203,7 @@ impl<'a> Parser<'a> { }; TokenStream::from_streams(smallvec![eq.into(), tokens]) } else { - TokenStream::empty() + TokenStream::default() }; ast::AttrItem { path, tokens } }) diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 400bf0f3856..478cfefc224 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -1273,7 +1273,7 @@ impl<'a> Parser<'a> { // This can happen due to a bad interaction of two unrelated recovery mechanisms with // mismatched delimiters *and* recovery lookahead on the likely typo `pub ident(` // (#62881). - return Ok((ret?, TokenStream::new(vec![]))); + return Ok((ret?, TokenStream::default())); } else { &mut self.token_cursor.stack[prev].last_token }; @@ -1288,7 +1288,7 @@ impl<'a> Parser<'a> { // This can happen due to a bad interaction of two unrelated recovery mechanisms // with mismatched delimiters *and* recovery lookahead on the likely typo // `pub ident(` (#62895, different but similar to the case above). - return Ok((ret?, TokenStream::new(vec![]))); + return Ok((ret?, TokenStream::default())); } }; |
