Skip to content

Commit

Permalink
Use _ to silence warnings (#418)
Browse files Browse the repository at this point in the history
Co-authored-by: Peter Glotfelty <peter@glotfelty.us>
  • Loading branch information
Peternator7 and Peter Glotfelty authored Feb 16, 2025
1 parent 4c1f6c1 commit 24e7a4f
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions strum_macros/src/helpers/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ impl Parse for EnumMeta {
}

pub enum EnumDiscriminantsMeta {
Derive { kw: kw::derive, paths: Vec<Path> },
Derive { _kw: kw::derive, paths: Vec<Path> },
Name { kw: kw::name, name: Ident },
Vis { kw: kw::vis, vis: Visibility },
Other { path: Path, nested: TokenStream },
Expand All @@ -120,12 +120,12 @@ pub enum EnumDiscriminantsMeta {
impl Parse for EnumDiscriminantsMeta {
fn parse(input: ParseStream) -> syn::Result<Self> {
if input.peek(kw::derive) {
let kw = input.parse()?;
let _kw = input.parse()?;
let content;
parenthesized!(content in input);
let paths = content.parse_terminated(Path::parse, Token![,])?;
Ok(EnumDiscriminantsMeta::Derive {
kw,
_kw,
paths: paths.into_iter().collect(),
})
} else if input.peek(kw::name) {
Expand Down Expand Up @@ -178,7 +178,7 @@ pub enum VariantMeta {
value: LitStr,
},
Serialize {
kw: kw::serialize,
_kw: kw::serialize,
value: LitStr,
},
Documentation {
Expand All @@ -199,7 +199,7 @@ pub enum VariantMeta {
value: bool,
},
Props {
kw: kw::props,
_kw: kw::props,
props: Vec<(LitStr, Lit)>,
},
}
Expand All @@ -218,10 +218,10 @@ impl Parse for VariantMeta {
let value = input.parse()?;
Ok(VariantMeta::DetailedMessage { kw, value })
} else if lookahead.peek(kw::serialize) {
let kw = input.parse()?;
let _kw = input.parse()?;
let _: Token![=] = input.parse()?;
let value = input.parse()?;
Ok(VariantMeta::Serialize { kw, value })
Ok(VariantMeta::Serialize { _kw, value })
} else if lookahead.peek(kw::to_string) {
let kw = input.parse()?;
let _: Token![=] = input.parse()?;
Expand All @@ -246,12 +246,12 @@ impl Parse for VariantMeta {
};
Ok(VariantMeta::AsciiCaseInsensitive { kw, value })
} else if lookahead.peek(kw::props) {
let kw = input.parse()?;
let _kw = input.parse()?;
let content;
parenthesized!(content in input);
let props = content.parse_terminated(Prop::parse, Token![,])?;
Ok(VariantMeta::Props {
kw,
_kw,
props: props
.into_iter()
.map(|Prop(k, v)| (LitStr::new(&k.to_string(), k.span()), v))
Expand Down

0 comments on commit 24e7a4f

Please sign in to comment.