mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
remove needless borrows
This commit is contained in:
parent
77051679d7
commit
ed128872eb
53 changed files with 87 additions and 87 deletions
|
@ -115,7 +115,8 @@ pub fn pseudo_derive_attr_expansion(
|
|||
};
|
||||
|
||||
let mut token_trees = Vec::new();
|
||||
for tt in (&args.token_trees)
|
||||
for tt in args
|
||||
.token_trees
|
||||
.split(|tt| matches!(tt, tt::TokenTree::Leaf(tt::Leaf::Punct(tt::Punct { char: ',', .. }))))
|
||||
{
|
||||
token_trees.push(mk_leaf('#'));
|
||||
|
|
|
@ -62,7 +62,7 @@ impl<'a> UnescapedName<'a> {
|
|||
it.clone()
|
||||
}
|
||||
}
|
||||
Repr::TupleField(it) => SmolStr::new(&it.to_string()),
|
||||
Repr::TupleField(it) => SmolStr::new(it.to_string()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -139,7 +139,7 @@ impl Name {
|
|||
pub fn to_smol_str(&self) -> SmolStr {
|
||||
match &self.0 {
|
||||
Repr::Text(it) => it.clone(),
|
||||
Repr::TupleField(it) => SmolStr::new(&it.to_string()),
|
||||
Repr::TupleField(it) => SmolStr::new(it.to_string()),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue