syntax: Fix warnings about clippy str_to_string rule

This commit is contained in:
Tetsuharu Ohzeki 2024-02-10 00:51:58 +09:00
parent f474bd77be
commit 81c35d1f56
6 changed files with 14 additions and 14 deletions

View file

@ -573,7 +573,7 @@ fn lower(grammar: &Grammar) -> AstSrc {
tokens:
"Whitespace Comment String ByteString CString IntNumber FloatNumber Char Byte Ident"
.split_ascii_whitespace()
.map(|it| it.to_string())
.map(|it| it.to_owned())
.collect::<Vec<_>>(),
..Default::default()
};
@ -816,7 +816,7 @@ fn extract_struct_trait(node: &mut AstNodeSrc, trait_name: &str, methods: &[&str
}
}
if to_remove.len() == methods.len() {
node.traits.push(trait_name.to_string());
node.traits.push(trait_name.to_owned());
node.remove_field(to_remove);
}
}