Skip to content

Commit 4026dde

Browse files
committed
bump declare_clippy_lint syn to 2.0
1 parent 015fb8a commit 4026dde

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

declare_clippy_lint/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ proc-macro = true
1010
[dependencies]
1111
itertools = "0.10.1"
1212
quote = "1.0.21"
13-
syn = "1.0.100"
13+
syn = "2.0"
1414

1515
[features]
1616
deny-warnings = []

declare_clippy_lint/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@
66
use proc_macro::TokenStream;
77
use quote::{format_ident, quote};
88
use syn::parse::{Parse, ParseStream};
9-
use syn::{parse_macro_input, Attribute, Error, Ident, Lit, LitStr, Meta, Result, Token};
9+
use syn::{parse_macro_input, Attribute, Error, Expr, ExprLit, Ident, Lit, LitStr, Meta, Result, Token};
1010

1111
fn parse_attr<const LEN: usize>(path: [&'static str; LEN], attr: &Attribute) -> Option<LitStr> {
12-
if let Meta::NameValue(name_value) = attr.parse_meta().ok()? {
12+
if let Meta::NameValue(name_value) = &attr.meta {
1313
let path_idents = name_value.path.segments.iter().map(|segment| &segment.ident);
1414

1515
if itertools::equal(path_idents, path)
16-
&& let Lit::Str(lit) = name_value.lit
16+
&& let Expr::Lit(ExprLit { lit: Lit::Str(s), .. }) = &name_value.value
1717
{
18-
return Some(lit);
18+
return Some(s.clone());
1919
}
2020
}
2121

0 commit comments

Comments
 (0)