Skip to content

Commit

Permalink
macros: Stop using syn's extra-traits feature (#378)
Browse files Browse the repository at this point in the history
… to reduce compile times.
  • Loading branch information
svix-jplatte authored Sep 29, 2024
1 parent 1454ced commit 9710f41
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion strum_macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ heck = "0.5.0"
proc-macro2 = "1.0"
quote = "1.0"
rustversion = "1.0"
syn = { version = "2.0", features = ["parsing", "extra-traits"] }
syn = { version = "2.0", features = ["parsing"] }

[dev-dependencies]
strum = { path = "../strum", version= "0.26" }
2 changes: 1 addition & 1 deletion strum_macros/src/helpers/inner_variant_props.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pub trait HasInnerVariantProperties {
fn get_variant_inner_properties(&self) -> syn::Result<StrumInnerVariantProperties>;
}

#[derive(Clone, Eq, PartialEq, Debug, Default)]
#[derive(Clone, Default)]
pub struct StrumInnerVariantProperties {
pub default_with: Option<LitStr>,
}
Expand Down
1 change: 0 additions & 1 deletion strum_macros/src/helpers/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,6 @@ fn get_metadata_inner<'a, T: Parse>(
})
}

#[derive(Debug)]
pub enum InnerVariantMeta {
DefaultWith { kw: kw::default_with, value: LitStr },
}
Expand Down
2 changes: 1 addition & 1 deletion strum_macros/src/helpers/type_props.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pub trait HasTypeProperties {
fn get_type_properties(&self) -> syn::Result<StrumTypeProperties>;
}

#[derive(Debug, Clone, Default)]
#[derive(Clone, Default)]
pub struct StrumTypeProperties {
pub case_style: Option<CaseStyle>,
pub ascii_case_insensitive: bool,
Expand Down
2 changes: 1 addition & 1 deletion strum_macros/src/helpers/variant_props.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pub trait HasStrumVariantProperties {
fn get_variant_properties(&self) -> syn::Result<StrumVariantProperties>;
}

#[derive(Clone, Eq, PartialEq, Debug, Default)]
#[derive(Clone, Default)]
pub struct StrumVariantProperties {
pub disabled: Option<kw::disabled>,
pub default: Option<kw::default>,
Expand Down
2 changes: 1 addition & 1 deletion strum_macros/src/macros/enum_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ pub fn enum_table_inner(ast: &DeriveInput) -> syn::Result<TokenStream> {
}

// Error on variants with data
if variant.fields != Fields::Unit {
if !matches!(variant.fields, Fields::Unit) {
return Err(syn::Error::new(
variant.fields.span(),
"`EnumTable` doesn't support enums with non-unit variants",
Expand Down

0 comments on commit 9710f41

Please sign in to comment.