remove needless borrows

This commit is contained in:
Daniel Eades 2022-12-30 08:05:03 +00:00
parent 77051679d7
commit ed128872eb
53 changed files with 87 additions and 87 deletions

View file

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

View file

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