From 925ab45954753054e4eaf0ac357ba5cff092c027 Mon Sep 17 00:00:00 2001 From: Yoshitomo Nakanishi Date: Fri, 22 Nov 2024 19:47:39 +0100 Subject: [PATCH 1/2] Bumpup syn version to 2.0 --- macros/Cargo.toml | 2 +- macros/src/lib.rs | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/macros/Cargo.toml b/macros/Cargo.toml index 9dfcd72..43def1b 100644 --- a/macros/Cargo.toml +++ b/macros/Cargo.toml @@ -12,7 +12,7 @@ description = "Provides a procedural macro for `dir-test`" proc_macro = true [dependencies] -syn = { version = "1.0", features = ["full"] } +syn = { version = "2.0", features = ["full"] } proc-macro2 = "1.0" quote = "1.0" glob = "0.3" diff --git a/macros/src/lib.rs b/macros/src/lib.rs index 81ed67f..4650fda 100644 --- a/macros/src/lib.rs +++ b/macros/src/lib.rs @@ -6,7 +6,6 @@ use std::{ use proc_macro2::Span; use quote::quote; - use syn::Token; type Error = syn::Error; @@ -143,7 +142,7 @@ impl TestBuilder { fn extract_test_attrs(&mut self) -> Result<()> { let mut err = Ok(()); self.func.attrs.retain(|attr| { - if attr.path.is_ident("dir_test_attr") { + if attr.path().is_ident("dir_test_attr") { err = err .clone() .and(attr.parse_args_with(|input: syn::parse::ParseStream| { From 1293fb5239c25a94ab24068ecd4543cfa8d4d2b1 Mon Sep 17 00:00:00 2001 From: Yoshitomo Nakanishi Date: Fri, 22 Nov 2024 19:50:06 +0100 Subject: [PATCH 2/2] Make clippy happy --- macros/src/lib.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/macros/src/lib.rs b/macros/src/lib.rs index 4650fda..8d43765 100644 --- a/macros/src/lib.rs +++ b/macros/src/lib.rs @@ -50,8 +50,7 @@ impl TestBuilder { let mut pattern = self.dir_test_arg.resolve_dir()?; pattern.push( - &self - .dir_test_arg + self.dir_test_arg .glob .clone() .map_or_else(|| "*".to_string(), |g| g.value()),