chore: update syn to v2

This commit is contained in:
Adrian Geipert 2025-06-18 09:11:22 +02:00 committed by GitHub
parent 7d7274b801
commit 90ed634b06
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 7 deletions

View file

@ -8,5 +8,5 @@ edition = "2021"
proc-macro = true proc-macro = true
[dependencies] [dependencies]
syn = "1.0" syn = "2.0"
quote = "1.0" quote = "1.0"

View file

@ -17,12 +17,16 @@ fn impl_cosmic_config_entry_macro(ast: &syn::DeriveInput) -> TokenStream {
let version = attributes let version = attributes
.iter() .iter()
.find_map(|attr| { .find_map(|attr| {
if attr.path.is_ident("version") { if attr.path().is_ident("version") {
match attr.parse_meta() { match attr.meta {
Ok(syn::Meta::NameValue(syn::MetaNameValue { syn::Meta::NameValue(syn::MetaNameValue {
lit: syn::Lit::Int(lit_int), value:
syn::Expr::Lit(syn::ExprLit {
lit: syn::Lit::Int(ref lit_int),
..
}),
.. ..
})) => Some(lit_int.base10_parse::<u64>().unwrap()), }) => Some(lit_int.base10_parse::<u64>().unwrap()),
_ => None, _ => None,
} }
} else { } else {