about summary refs log tree commit diff
path: root/src/librustc_parse/parser
diff options
context:
space:
mode:
authorDylan DPC <dylan.dpc@gmail.com>2020-02-28 01:55:49 +0100
committerGitHub <noreply@github.com>2020-02-28 01:55:49 +0100
commit02b96b3ecc48dc5245e425fc248163cfaae9643e (patch)
treebad29616a580bcc720dcbedc94715e30ee89ba01 /src/librustc_parse/parser
parent4c9e44fc5f2958706fb747d7ccf4d49f1f384545 (diff)
parent7be94a8a958750cf57c0fa41ad7797a2cd1630de (diff)
downloadrust-02b96b3ecc48dc5245e425fc248163cfaae9643e.tar.gz
rust-02b96b3ecc48dc5245e425fc248163cfaae9643e.zip
Rollup merge of #69529 - matthiaskrgr:clippy_identity_conversion, r=Mark-Simulacrum
don't use .into() to convert types into identical types.

This removes redundant `.into()` calls.

example: `let s: String = format!("hello").into();`
Diffstat (limited to 'src/librustc_parse/parser')
-rw-r--r--src/librustc_parse/parser/mod.rs7
-rw-r--r--src/librustc_parse/parser/stmt.rs2
2 files changed, 4 insertions, 5 deletions
diff --git a/src/librustc_parse/parser/mod.rs b/src/librustc_parse/parser/mod.rs
index 75d4b3750f1..7b8642b0151 100644
--- a/src/librustc_parse/parser/mod.rs
+++ b/src/librustc_parse/parser/mod.rs
@@ -263,8 +263,7 @@ impl TokenCursor {
             ]
             .iter()
             .cloned()
-            .collect::<TokenStream>()
-            .into(),
+            .collect::<TokenStream>(),
         );
 
         self.stack.push(mem::replace(
@@ -389,7 +388,7 @@ impl<'a> Parser<'a> {
             root_module_name: None,
             expected_tokens: Vec::new(),
             token_cursor: TokenCursor {
-                frame: TokenCursorFrame::new(DelimSpan::dummy(), token::NoDelim, &tokens.into()),
+                frame: TokenCursorFrame::new(DelimSpan::dummy(), token::NoDelim, &tokens),
                 stack: Vec::new(),
             },
             desugar_doc_comments,
@@ -1006,7 +1005,7 @@ impl<'a> Parser<'a> {
                 );
                 self.set_token(Token::new(TokenKind::CloseDelim(frame.delim), frame.span.close));
                 self.bump();
-                TokenTree::Delimited(frame.span, frame.delim, frame.tree_cursor.stream.into())
+                TokenTree::Delimited(frame.span, frame.delim, frame.tree_cursor.stream)
             }
             token::CloseDelim(_) | token::Eof => unreachable!(),
             _ => {
diff --git a/src/librustc_parse/parser/stmt.rs b/src/librustc_parse/parser/stmt.rs
index d2a6f0b7fcf..257292ae072 100644
--- a/src/librustc_parse/parser/stmt.rs
+++ b/src/librustc_parse/parser/stmt.rs
@@ -169,7 +169,7 @@ impl<'a> Parser<'a> {
     }
 
     fn parse_local_mk(&mut self, lo: Span, attrs: AttrVec) -> PResult<'a, Stmt> {
-        let local = self.parse_local(attrs.into())?;
+        let local = self.parse_local(attrs)?;
         Ok(self.mk_stmt(lo.to(self.prev_span), StmtKind::Local(local)))
     }