From 84918046c8b2bc65b109b4f70d193d4a3616197c Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sat, 11 Feb 2023 23:06:33 -0800 Subject: [PATCH] Update to syn 2 --- .clippy.toml | 2 +- .github/workflows/ci.yml | 2 +- Cargo.toml | 4 ++-- src/lib.rs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.clippy.toml b/.clippy.toml index 3d30690..0d369b5 100644 --- a/.clippy.toml +++ b/.clippy.toml @@ -1 +1 @@ -msrv = "1.31.0" +msrv = "1.56.0" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d7ebcc9..795a469 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,7 @@ jobs: strategy: fail-fast: false matrix: - rust: [nightly, beta, stable, 1.31.0] + rust: [nightly, beta, stable, 1.56.0] timeout-minutes: 45 steps: - uses: actions/checkout@v3 diff --git a/Cargo.toml b/Cargo.toml index 6e5e9c1..07ef3ec 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ edition = "2018" keywords = ["enum", "integer"] license = "MIT OR Apache-2.0" repository = "https://github.com/dtolnay/enumn" -rust-version = "1.31" +rust-version = "1.56" [lib] proc-macro = true @@ -17,7 +17,7 @@ proc-macro = true [dependencies] proc-macro2 = "1.0" quote = "1.0" -syn = "1.0" +syn = "2.0" [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/src/lib.rs b/src/lib.rs index 1a2b270..3bd72c1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -141,7 +141,7 @@ pub fn derive(input: TokenStream) -> TokenStream { // Parse repr attribute like #[repr(u16)]. let mut repr = None; for attr in input.attrs { - if attr.path.is_ident("repr") { + if attr.path().is_ident("repr") { if let Ok(name) = attr.parse_args::() { match name.to_string().as_str() { "u8" | "u16" | "u32" | "u64" | "u128" | "usize" | "i8" | "i16" | "i32"