bump declare_clippy_lint syn to 2.0

This commit is contained in:
Deadbeef 2023-04-10 16:53:31 +08:00
parent 015fb8a9e3
commit 4026dde4e5
2 changed files with 5 additions and 5 deletions

View File

@ -10,7 +10,7 @@ proc-macro = true
[dependencies]
itertools = "0.10.1"
quote = "1.0.21"
syn = "1.0.100"
syn = "2.0"
[features]
deny-warnings = []

View File

@ -6,16 +6,16 @@
use proc_macro::TokenStream;
use quote::{format_ident, quote};
use syn::parse::{Parse, ParseStream};
use syn::{parse_macro_input, Attribute, Error, Ident, Lit, LitStr, Meta, Result, Token};
use syn::{parse_macro_input, Attribute, Error, Expr, ExprLit, Ident, Lit, LitStr, Meta, Result, Token};
fn parse_attr<const LEN: usize>(path: [&'static str; LEN], attr: &Attribute) -> Option<LitStr> {
if let Meta::NameValue(name_value) = attr.parse_meta().ok()? {
if let Meta::NameValue(name_value) = &attr.meta {
let path_idents = name_value.path.segments.iter().map(|segment| &segment.ident);
if itertools::equal(path_idents, path)
&& let Lit::Str(lit) = name_value.lit
&& let Expr::Lit(ExprLit { lit: Lit::Str(s), .. }) = &name_value.value
{
return Some(lit);
return Some(s.clone());
}
}