mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-08-22 11:24:24 +00:00
avoid converting types into themselves via .into() (clippy::useless-conversion)
example: let x: String = String::from("hello world").into();
This commit is contained in:
parent
83e6940efb
commit
966c23f529
24 changed files with 56 additions and 61 deletions
|
@ -130,7 +130,7 @@ pub fn parse_exprs_with_sep(tt: &tt::Subtree, sep: char) -> Vec<tt::Subtree> {
|
|||
res.push(match expanded.value {
|
||||
None => break,
|
||||
Some(tt @ tt::TokenTree::Leaf(_)) => {
|
||||
tt::Subtree { delimiter: None, token_trees: vec![tt.into()] }
|
||||
tt::Subtree { delimiter: None, token_trees: vec![tt] }
|
||||
}
|
||||
Some(tt::TokenTree::Subtree(tt)) => tt,
|
||||
});
|
||||
|
@ -727,7 +727,7 @@ impl<'a> TreeSink for TtTreeSink<'a> {
|
|||
// Note: We always assume the semi-colon would be the last token in
|
||||
// other parts of RA such that we don't add whitespace here.
|
||||
if curr.spacing == tt::Spacing::Alone && curr.char != ';' {
|
||||
self.inner.token(WHITESPACE, " ".into());
|
||||
self.inner.token(WHITESPACE, " ");
|
||||
self.text_pos += TextSize::of(' ');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue