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();`
This commit is contained in:
commit
02b96b3ecc
32 changed files with 42 additions and 62 deletions
|
|
@ -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!(),
|
||||
_ => {
|
||||
|
|
|
|||
|
|
@ -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)))
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue