diff --git a/core/src/ast/data.rs b/core/src/ast/data.rs index 03036d8..d024cad 100644 --- a/core/src/ast/data.rs +++ b/core/src/ast/data.rs @@ -403,7 +403,7 @@ impl From for Style { } } -impl<'a> From<&'a syn::Fields> for Style { +impl From<&syn::Fields> for Style { fn from(vd: &syn::Fields) -> Self { match *vd { syn::Fields::Named(_) => Style::Struct, diff --git a/core/src/codegen/default_expr.rs b/core/src/codegen/default_expr.rs index fa8b159..8741e23 100644 --- a/core/src/codegen/default_expr.rs +++ b/core/src/codegen/default_expr.rs @@ -23,7 +23,7 @@ impl<'a> DefaultExpression<'a> { } } -impl<'a> ToTokens for DefaultExpression<'a> { +impl ToTokens for DefaultExpression<'_> { fn to_tokens(&self, tokens: &mut TokenStream) { tokens.append_all(match *self { DefaultExpression::Inherit(ident) => { @@ -44,7 +44,7 @@ impl<'a> ToTokens for DefaultExpression<'a> { /// Used only by containers, this wrapper type generates code to declare the fallback instance. pub struct DefaultDeclaration<'a>(&'a DefaultExpression<'a>); -impl<'a> ToTokens for DefaultDeclaration<'a> { +impl ToTokens for DefaultDeclaration<'_> { fn to_tokens(&self, tokens: &mut TokenStream) { let name = Ident::new(DEFAULT_STRUCT_NAME, ::proc_macro2::Span::call_site()); let expr = self.0; diff --git a/core/src/codegen/error.rs b/core/src/codegen/error.rs index f93a740..3e73903 100644 --- a/core/src/codegen/error.rs +++ b/core/src/codegen/error.rs @@ -31,7 +31,7 @@ impl<'a> ErrorCheck<'a> { } } -impl<'a> ToTokens for ErrorCheck<'a> { +impl ToTokens for ErrorCheck<'_> { fn to_tokens(&self, tokens: &mut TokenStream) { let at_call = if let Some(ref s) = self.location { quote!(.map_err(|e| e.at(#s))) diff --git a/core/src/codegen/field.rs b/core/src/codegen/field.rs index a666422..3ada543 100644 --- a/core/src/codegen/field.rs +++ b/core/src/codegen/field.rs @@ -74,7 +74,7 @@ impl<'a> Field<'a> { } } -impl<'a> UsesTypeParams for Field<'a> { +impl UsesTypeParams for Field<'_> { fn uses_type_params<'b>( &self, options: &usage::Options, @@ -87,7 +87,7 @@ impl<'a> UsesTypeParams for Field<'a> { /// An individual field during variable declaration in the generated parsing method. pub struct Declaration<'a>(&'a Field<'a>); -impl<'a> ToTokens for Declaration<'a> { +impl ToTokens for Declaration<'_> { fn to_tokens(&self, tokens: &mut TokenStream) { let field = self.0; let ident = field.ident; @@ -118,7 +118,7 @@ pub struct FlattenInitializer<'a> { parent_field_names: Vec<&'a str>, } -impl<'a> ToTokens for FlattenInitializer<'a> { +impl ToTokens for FlattenInitializer<'_> { fn to_tokens(&self, tokens: &mut TokenStream) { let Self { field, @@ -147,7 +147,7 @@ impl<'a> ToTokens for FlattenInitializer<'a> { /// Represents an individual field in the match. pub struct MatchArm<'a>(&'a Field<'a>); -impl<'a> ToTokens for MatchArm<'a> { +impl ToTokens for MatchArm<'_> { fn to_tokens(&self, tokens: &mut TokenStream) { let field = self.0; @@ -216,7 +216,7 @@ impl<'a> ToTokens for MatchArm<'a> { /// Wrapper to generate initialization code for a field. pub struct Initializer<'a>(&'a Field<'a>); -impl<'a> ToTokens for Initializer<'a> { +impl ToTokens for Initializer<'_> { fn to_tokens(&self, tokens: &mut TokenStream) { let field = self.0; let ident = field.ident; @@ -245,7 +245,7 @@ impl<'a> ToTokens for Initializer<'a> { /// Creates an error if a field has no value and no default. pub struct CheckMissing<'a>(&'a Field<'a>); -impl<'a> ToTokens for CheckMissing<'a> { +impl ToTokens for CheckMissing<'_> { fn to_tokens(&self, tokens: &mut TokenStream) { if !self.0.multiple && self.0.default_expression.is_none() { let ident = self.0.ident; diff --git a/core/src/codegen/from_attributes_impl.rs b/core/src/codegen/from_attributes_impl.rs index 1e40c26..90cba63 100644 --- a/core/src/codegen/from_attributes_impl.rs +++ b/core/src/codegen/from_attributes_impl.rs @@ -72,7 +72,7 @@ impl ToTokens for FromAttributesImpl<'_> { } } -impl<'a> ExtractAttribute for FromAttributesImpl<'a> { +impl ExtractAttribute for FromAttributesImpl<'_> { fn local_declarations(&self) -> TokenStream { self.base.local_declarations() } diff --git a/core/src/codegen/from_derive_impl.rs b/core/src/codegen/from_derive_impl.rs index cc96946..347972a 100644 --- a/core/src/codegen/from_derive_impl.rs +++ b/core/src/codegen/from_derive_impl.rs @@ -23,7 +23,7 @@ pub struct FromDeriveInputImpl<'a> { pub supports: Option<&'a DeriveInputShapeSet>, } -impl<'a> ToTokens for FromDeriveInputImpl<'a> { +impl ToTokens for FromDeriveInputImpl<'_> { fn to_tokens(&self, tokens: &mut TokenStream) { let ty_ident = self.base.ident; let input = self.param_name(); @@ -115,7 +115,7 @@ impl<'a> ToTokens for FromDeriveInputImpl<'a> { } } -impl<'a> ExtractAttribute for FromDeriveInputImpl<'a> { +impl ExtractAttribute for FromDeriveInputImpl<'_> { fn attr_names(&self) -> &PathList { self.attr_names } diff --git a/core/src/codegen/from_field.rs b/core/src/codegen/from_field.rs index d29b77d..9c5e3a5 100644 --- a/core/src/codegen/from_field.rs +++ b/core/src/codegen/from_field.rs @@ -21,7 +21,7 @@ pub struct FromFieldImpl<'a> { pub from_ident: bool, } -impl<'a> ToTokens for FromFieldImpl<'a> { +impl ToTokens for FromFieldImpl<'_> { fn to_tokens(&self, tokens: &mut TokenStream) { let input = self.param_name(); @@ -77,7 +77,7 @@ impl<'a> ToTokens for FromFieldImpl<'a> { } } -impl<'a> ExtractAttribute for FromFieldImpl<'a> { +impl ExtractAttribute for FromFieldImpl<'_> { fn attr_names(&self) -> &PathList { self.attr_names } diff --git a/core/src/codegen/from_meta_impl.rs b/core/src/codegen/from_meta_impl.rs index cc8f87e..ec34fbe 100644 --- a/core/src/codegen/from_meta_impl.rs +++ b/core/src/codegen/from_meta_impl.rs @@ -8,7 +8,7 @@ pub struct FromMetaImpl<'a> { pub base: TraitImpl<'a>, } -impl<'a> ToTokens for FromMetaImpl<'a> { +impl ToTokens for FromMetaImpl<'_> { fn to_tokens(&self, tokens: &mut TokenStream) { let base = &self.base; diff --git a/core/src/codegen/from_type_param.rs b/core/src/codegen/from_type_param.rs index 5f356fd..92c2174 100644 --- a/core/src/codegen/from_type_param.rs +++ b/core/src/codegen/from_type_param.rs @@ -15,7 +15,7 @@ pub struct FromTypeParamImpl<'a> { pub from_ident: bool, } -impl<'a> ToTokens for FromTypeParamImpl<'a> { +impl ToTokens for FromTypeParamImpl<'_> { fn to_tokens(&self, tokens: &mut TokenStream) { let input = self.param_name(); @@ -74,7 +74,7 @@ impl<'a> ToTokens for FromTypeParamImpl<'a> { } } -impl<'a> ExtractAttribute for FromTypeParamImpl<'a> { +impl ExtractAttribute for FromTypeParamImpl<'_> { fn attr_names(&self) -> &PathList { self.attr_names } diff --git a/core/src/codegen/from_variant_impl.rs b/core/src/codegen/from_variant_impl.rs index 6febde0..ffb5d52 100644 --- a/core/src/codegen/from_variant_impl.rs +++ b/core/src/codegen/from_variant_impl.rs @@ -31,7 +31,7 @@ pub struct FromVariantImpl<'a> { pub supports: Option<&'a DataShape>, } -impl<'a> ToTokens for FromVariantImpl<'a> { +impl ToTokens for FromVariantImpl<'_> { fn to_tokens(&self, tokens: &mut TokenStream) { let input = self.param_name(); let extractor = self.extractor(); @@ -97,7 +97,7 @@ impl<'a> ToTokens for FromVariantImpl<'a> { } } -impl<'a> ExtractAttribute for FromVariantImpl<'a> { +impl ExtractAttribute for FromVariantImpl<'_> { fn local_declarations(&self) -> TokenStream { self.base.local_declarations() } diff --git a/core/src/codegen/variant.rs b/core/src/codegen/variant.rs index 9ce643f..5c97d87 100644 --- a/core/src/codegen/variant.rs +++ b/core/src/codegen/variant.rs @@ -47,7 +47,7 @@ impl<'a> Variant<'a> { } } -impl<'a> UsesTypeParams for Variant<'a> { +impl UsesTypeParams for Variant<'_> { fn uses_type_params<'b>( &self, options: &usage::Options, @@ -57,7 +57,7 @@ impl<'a> UsesTypeParams for Variant<'a> { } } -impl<'a> ToTokens for Variant<'a> { +impl ToTokens for Variant<'_> { fn to_tokens(&self, tokens: &mut TokenStream) { if self.data.is_unit() { self.as_unit_match_arm().to_tokens(tokens); @@ -72,9 +72,9 @@ impl<'a> ToTokens for Variant<'a> { /// Value-carrying variants wrapped in this type will emit code to produce an "unsupported format" error. pub struct UnitMatchArm<'a>(&'a Variant<'a>); -impl<'a> ToTokens for UnitMatchArm<'a> { +impl ToTokens for UnitMatchArm<'_> { fn to_tokens(&self, tokens: &mut TokenStream) { - let val: &Variant<'a> = self.0; + let val: &Variant<'_> = self.0; if val.skip { return; @@ -128,9 +128,9 @@ impl<'a> ToTokens for UnitMatchArm<'a> { /// Unit variants wrapped in this type will emit code to produce an "unsupported format" error. pub struct DataMatchArm<'a>(&'a Variant<'a>); -impl<'a> ToTokens for DataMatchArm<'a> { +impl ToTokens for DataMatchArm<'_> { fn to_tokens(&self, tokens: &mut TokenStream) { - let val: &Variant<'a> = self.0; + let val: &Variant<'_> = self.0; if val.skip { return; diff --git a/core/src/util/ident_string.rs b/core/src/util/ident_string.rs index 3b926cd..2bfa3b4 100644 --- a/core/src/util/ident_string.rs +++ b/core/src/util/ident_string.rs @@ -99,7 +99,7 @@ impl PartialEq for IdentString { } } -impl<'a> PartialEq<&'a str> for IdentString { +impl PartialEq<&str> for IdentString { fn eq(&self, rhs: &&str) -> bool { self.as_str() == *rhs }