avoid converting types into themselves via .into() (clippy::useless-conversion)

example: let x: String = String::from("hello world").into();
This commit is contained in:
Matthias Krüger 2021-03-17 01:27:56 +01:00
parent 83e6940efb
commit 966c23f529
24 changed files with 56 additions and 61 deletions

View file

@ -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())
}
}
};