clippy::perf fixes
This commit is contained in:
parent
03d488b48a
commit
611bbcb044
10 changed files with 17 additions and 21 deletions
|
@ -212,7 +212,7 @@ impl DiagnosticDeriveBuilder {
|
|||
}
|
||||
NestedMeta::Meta(meta @ Meta::NameValue(_))
|
||||
if !is_help_note_or_warn
|
||||
&& meta.path().segments.last().unwrap().ident.to_string() == "code" =>
|
||||
&& meta.path().segments.last().unwrap().ident == "code" =>
|
||||
{
|
||||
// don't error for valid follow-up attributes
|
||||
}
|
||||
|
|
|
@ -194,8 +194,8 @@ pub(crate) fn fluent_messages(input: proc_macro::TokenStream) -> proc_macro::Tok
|
|||
let snake_name = Ident::new(
|
||||
// FIXME: should probably trim prefix, not replace all occurrences
|
||||
&name
|
||||
.replace(&format!("{}-", res.ident).replace("_", "-"), "")
|
||||
.replace("-", "_"),
|
||||
.replace(&format!("{}-", res.ident).replace('_', "-"), "")
|
||||
.replace('-', "_"),
|
||||
span,
|
||||
);
|
||||
constants.extend(quote! {
|
||||
|
@ -207,7 +207,7 @@ pub(crate) fn fluent_messages(input: proc_macro::TokenStream) -> proc_macro::Tok
|
|||
});
|
||||
|
||||
for Attribute { id: Identifier { name: attr_name }, .. } in attributes {
|
||||
let snake_name = Ident::new(&attr_name.replace("-", "_"), span);
|
||||
let snake_name = Ident::new(&attr_name.replace('-', "_"), span);
|
||||
if !previous_attrs.insert(snake_name.clone()) {
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue