mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +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
|
@ -120,7 +120,7 @@ fn invocation_fixtures(rules: &FxHashMap<String, MacroRules>) -> Vec<(String, tt
|
|||
Some("pat") => parent.token_trees.push(make_ident("foo")),
|
||||
Some("path") => parent.token_trees.push(make_ident("foo")),
|
||||
Some("literal") => parent.token_trees.push(make_literal("1")),
|
||||
Some("expr") => parent.token_trees.push(make_ident("foo").into()),
|
||||
Some("expr") => parent.token_trees.push(make_ident("foo")),
|
||||
Some("lifetime") => {
|
||||
parent.token_trees.push(make_punct('\''));
|
||||
parent.token_trees.push(make_ident("a"));
|
||||
|
@ -157,17 +157,15 @@ fn invocation_fixtures(rules: &FxHashMap<String, MacroRules>) -> Vec<(String, tt
|
|||
if i + 1 != cnt {
|
||||
if let Some(sep) = separator {
|
||||
match sep {
|
||||
Separator::Literal(it) => parent
|
||||
.token_trees
|
||||
.push(tt::Leaf::Literal(it.clone().into()).into()),
|
||||
Separator::Ident(it) => parent
|
||||
.token_trees
|
||||
.push(tt::Leaf::Ident(it.clone().into()).into()),
|
||||
Separator::Literal(it) => {
|
||||
parent.token_trees.push(tt::Leaf::Literal(it.clone()).into())
|
||||
}
|
||||
Separator::Ident(it) => {
|
||||
parent.token_trees.push(tt::Leaf::Ident(it.clone()).into())
|
||||
}
|
||||
Separator::Puncts(puncts) => {
|
||||
for it in puncts {
|
||||
parent
|
||||
.token_trees
|
||||
.push(tt::Leaf::Punct(it.clone().into()).into())
|
||||
parent.token_trees.push(tt::Leaf::Punct(it.clone()).into())
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue