about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--declare_clippy_lint/Cargo.toml2
-rw-r--r--declare_clippy_lint/src/lib.rs8
2 files changed, 5 insertions, 5 deletions
diff --git a/declare_clippy_lint/Cargo.toml b/declare_clippy_lint/Cargo.toml
index 5c9f76dbbc6..bd26f4fc913 100644
--- a/declare_clippy_lint/Cargo.toml
+++ b/declare_clippy_lint/Cargo.toml
@@ -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 = []
diff --git a/declare_clippy_lint/src/lib.rs b/declare_clippy_lint/src/lib.rs
index 26210556d65..5232e4ab7d7 100644
--- a/declare_clippy_lint/src/lib.rs
+++ b/declare_clippy_lint/src/lib.rs
@@ -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());
         }
     }