mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-15 14:18:04 +08:00
A few minor lints and docs (#1436)
* A few minor lints and docs * Added required packages to compile on Debian-style linux * Inlined some format args, and removed some `&` in args (they cause about 6% slowdown that compiler cannot inline) * a few spelling mistakes * fix fmt
This commit is contained in:
@@ -116,7 +116,7 @@ fn top_level_impl(input_item: TokenStream) -> syn::Result<TokenStream> {
|
||||
}
|
||||
|
||||
let input_type = &input.ident;
|
||||
let discriminant = call_site_ident(format!("{}Discriminant", input_type));
|
||||
let discriminant = call_site_ident(format!("{input_type}Discriminant"));
|
||||
|
||||
Ok(quote::quote! {
|
||||
#input
|
||||
|
||||
@@ -24,7 +24,7 @@ pub fn derive_discriminant_impl(input_item: TokenStream) -> syn::Result<TokenStr
|
||||
};
|
||||
is_sub_discriminant.push(true);
|
||||
}
|
||||
n => unimplemented!("#[sub_discriminant] on variants with {} fields is not supported (for now)", n),
|
||||
n => unimplemented!("#[sub_discriminant] on variants with {n} fields is not supported (for now)"),
|
||||
}
|
||||
} else {
|
||||
var.fields = Fields::Unit;
|
||||
|
||||
@@ -21,7 +21,7 @@ fn parse_hint_helper_attrs(attrs: &[Attribute]) -> syn::Result<(Vec<LitStr>, Vec
|
||||
// the first value is ok, the other ones should error
|
||||
let after_first = v.into_iter().skip(1);
|
||||
// this call to fold_error_iter will always return Err with a combined error
|
||||
fold_error_iter(after_first.map(|lit| Err(syn::Error::new(lit.span(), format!("value for key {} was already given", k))))).map(|_: Vec<()>| unreachable!())
|
||||
fold_error_iter(after_first.map(|lit| Err(syn::Error::new(lit.span(), format!("value for key {k} was already given"))))).map(|_: Vec<()>| unreachable!())
|
||||
}
|
||||
}))
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user