diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-06-27 23:01:09 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-06-27 23:01:09 +0200 |
| commit | 4aa3e27231a705e1aea4347ae78698c81438f1f4 (patch) | |
| tree | b545d4f98342098b68903c87e0bfb1795485fc40 /src/libsyntax/parse | |
| parent | bc335d6c16bc7bb9df1e1e2b982aa13963e8ae7c (diff) | |
| parent | ad62b4203ce3f0bd4c7c348aeabca4f49d5ce075 (diff) | |
| download | rust-4aa3e27231a705e1aea4347ae78698c81438f1f4.tar.gz rust-4aa3e27231a705e1aea4347ae78698c81438f1f4.zip | |
Rollup merge of #62131 - Xanewok:clip-some-nits, r=petrochenkov
libsyntax: Fix some Clippy warnings When I was working on it before a lot of these popped up in the RLS so I figured I'll send a small patch fixing only the (hopefully) uncontroversial ones. Others that could be also fixed included also [`clippy::print_with_newline`](https://rust-lang.github.io/rust-clippy/master/index.html#print_with_newline) and [`clippy::cast_lossless`](https://rust-lang.github.io/rust-clippy/master/index.html#cast_lossless). Should I add them as well? since most of it touches libsyntax... r? @petrochenkov
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index a1440f2eba4..fc206580e38 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -290,10 +290,10 @@ crate enum LastToken { } impl TokenCursorFrame { - fn new(sp: DelimSpan, delim: DelimToken, tts: &TokenStream) -> Self { + fn new(span: DelimSpan, delim: DelimToken, tts: &TokenStream) -> Self { TokenCursorFrame { - delim: delim, - span: sp, + delim, + span, open_delim: delim == token::NoDelim, tree_cursor: tts.clone().into_trees(), close_delim: delim == token::NoDelim, @@ -1449,7 +1449,7 @@ impl<'a> Parser<'a> { let opt_lifetime = if self.check_lifetime() { Some(self.expect_lifetime()) } else { None }; let mutbl = self.parse_mutability(); let ty = self.parse_ty_no_plus()?; - return Ok(TyKind::Rptr(opt_lifetime, MutTy { ty: ty, mutbl: mutbl })); + return Ok(TyKind::Rptr(opt_lifetime, MutTy { ty, mutbl })); } fn parse_ptr(&mut self) -> PResult<'a, MutTy> { @@ -1467,7 +1467,7 @@ impl<'a> Parser<'a> { Mutability::Immutable }; let t = self.parse_ty_no_plus()?; - Ok(MutTy { ty: t, mutbl: mutbl }) + Ok(MutTy { ty: t, mutbl }) } fn is_named_argument(&self) -> bool { @@ -4366,7 +4366,7 @@ impl<'a> Parser<'a> { self.report_invalid_macro_expansion_item(); } - (ident, ast::MacroDef { tokens: tokens, legacy: true }) + (ident, ast::MacroDef { tokens, legacy: true }) } _ => return Ok(None), }; @@ -6789,12 +6789,12 @@ impl<'a> Parser<'a> { let hi = self.token.span; self.expect(&token::Semi)?; Ok(ast::ForeignItem { - ident: ident, - attrs: attrs, + ident, + attrs, node: ForeignItemKind::Ty, id: ast::DUMMY_NODE_ID, span: lo.to(hi), - vis: vis + vis }) } |
