🚨 Aplica cambios por sugerencias de clippy

This commit is contained in:
Manuel Cillero 2025-08-05 18:52:00 +02:00
parent 8f350c320b
commit b4cbfc4775
3 changed files with 10 additions and 8 deletions

View file

@ -177,10 +177,9 @@ pub fn builder_fn(_: TokenStream, item: TokenStream) -> TokenStream {
let fn_with_attrs = &fn_with.attrs;
// Genera el método alter_...() con el código del método with_...().
let fn_alter_doc = format!(
"Igual que [`Self::{0}()`](Self::{0}), pero sin usar el patrón *builder*.",
fn_with_name_str,
);
let fn_alter_doc =
format!("Igual que [`Self::{fn_with_name_str}()`], pero sin usar el patrón *builder*.");
let fn_alter = quote! {
#[doc = #fn_alter_doc]
pub fn #fn_alter_name #fn_generics(&mut self, #(#args),*) -> &mut Self #where_clause {

View file

@ -44,6 +44,7 @@ impl<E: ToTokens> ToTokens for Markups<E> {
}
#[derive(Debug, Clone)]
#[allow(clippy::large_enum_variant)]
pub enum Markup<E> {
Block(Block<E>),
Lit(HtmlLit),
@ -429,6 +430,7 @@ impl ToTokens for Attribute {
}
#[derive(Debug, Clone)]
#[allow(clippy::large_enum_variant)]
pub enum HtmlNameOrMarkup {
HtmlName(HtmlName),
Markup(Markup<NoElement>),
@ -472,6 +474,7 @@ impl Display for HtmlNameOrMarkup {
}
#[derive(Debug, Clone)]
#[allow(clippy::large_enum_variant)]
pub enum AttributeType {
Normal {
eq_token: Eq,

View file

@ -19,7 +19,7 @@ pub fn impl_my_derive(input: &DeriveInput) -> Result<TokenStream, Error> {
quote! {
#name #body_assignment
},
format!("Returns a `{}` default.", name),
format!("Returns a `{name}` default."),
)
}
syn::Data::Enum(ref body) => {
@ -44,7 +44,7 @@ pub fn impl_my_derive(input: &DeriveInput) -> Result<TokenStream, Error> {
quote! {
#name :: #default_variant_name #body_assignment
},
format!("Returns a `{}::{}` default.", name, default_variant_name),
format!("Returns a `{name}::{default_variant_name}` default."),
)
}
syn::Data::Union(_) => {
@ -109,7 +109,7 @@ fn default_body_tt(body: &syn::Fields) -> Result<(TokenStream, String), Error> {
.iter()
.map(|field| {
let (default_value, default_doc) = field_default_expr_and_doc(field)?;
write!(&mut doc, "{}, ", default_doc).unwrap();
write!(&mut doc, "{default_doc}, ").unwrap();
Ok(default_value)
})
.collect::<Result<Vec<TokenStream>, Error>>()?;
@ -145,7 +145,7 @@ fn field_default_expr_and_doc(field: &syn::Field) -> Result<(TokenStream, String
ConversionStrategy::Into => quote!((#field_value).into()),
};
let field_doc = format!("{}", field_value);
let field_doc = format!("{field_value}");
Ok((field_value, field_doc))
} else {
Ok((