From 373eb0523dafb62aa719546d4f798eb3b6eeade4 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Wed, 28 Sep 2022 15:09:09 -0500 Subject: [PATCH 1/2] refactor: Upgrade to clap v4 --- Cargo.toml | 2 +- src/lib.rs | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index f217616..f39d167 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,6 +32,6 @@ default = ["clap"] [dependencies] difference = "2.0.0" -clap = { version = "3.0", features = ["derive"], optional = true } +clap = { version = "4.0.0", features = ["std", "derive"], optional = true } normalize-line-endings = "0.3.0" derive_more = "0.99.2" diff --git a/src/lib.rs b/src/lib.rs index ea0317a..64ef183 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -32,19 +32,19 @@ use clap::Args; /// ```rust /// #[derive(clap::Parser)] /// struct Args{ -/// #[clap(short('i'), long, parse(from_os_str))] +/// #[arg(short('i'), long)] /// input: std::path::PathBuf, -/// #[clap(flatten)] +/// #[command(flatten)] /// codegen: codegenrs::CodeGenArgs, /// } /// ``` #[cfg(feature = "clap")] #[derive(Debug, Args)] pub struct CodeGenArgs { - #[clap(short('o'), long, parse(from_os_str))] + #[arg(short('o'), long)] output: std::path::PathBuf, - #[clap(long)] + #[arg(long)] check: bool, } @@ -101,18 +101,18 @@ pub fn write_str( /// ```rust /// #[derive(clap::Parser)] /// struct Args{ -/// #[clap(short('i'), long, parse(from_os_str))] +/// #[arg(short('i'), long)] /// input: std::path::PathBuf, -/// #[clap(flatten)] +/// #[command(flatten)] /// codegen: codegenrs::CodeGenArgs, -/// #[clap(flatten)] +/// #[command(flatten)] /// rustfmt: codegenrs::RustfmtArgs, /// } /// ``` #[cfg(feature = "clap")] #[derive(Debug, Args)] pub struct RustfmtArgs { - #[clap(long, parse(from_os_str))] + #[arg(long)] rustfmt_config: Option, } From ff51397f08e390900f36376e9a6a112d2920480e Mon Sep 17 00:00:00 2001 From: Ed Page Date: Wed, 28 Sep 2022 15:10:18 -0500 Subject: [PATCH 2/2] chore: Update MSRV to 1.60.0 --- .clippy.toml | 2 +- .github/workflows/ci.yml | 6 +++--- .github/workflows/rust-next.yml | 4 ++-- Cargo.toml | 3 ++- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.clippy.toml b/.clippy.toml index fc3ef79..23bf481 100644 --- a/.clippy.toml +++ b/.clippy.toml @@ -1 +1 @@ -msrv = "1.54.0" # MSRV +msrv = "1.60.0" # MSRV diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eb56ab8..61178bb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,7 +51,7 @@ jobs: - name: No-default features run: cargo test --workspace --no-default-features msrv: - name: "Check MSRV: 1.54.0" + name: "Check MSRV: 1.60.0" runs-on: ubuntu-latest steps: - name: Checkout repository @@ -59,7 +59,7 @@ jobs: - name: Install Rust uses: actions-rs/toolchain@v1 with: - toolchain: 1.54.0 # MSRV + toolchain: 1.60.0 # MSRV profile: minimal override: true - uses: Swatinem/rust-cache@v1 @@ -113,7 +113,7 @@ jobs: - name: Install Rust uses: actions-rs/toolchain@v1 with: - toolchain: 1.54.0 # MSRV + toolchain: 1.60.0 # MSRV profile: minimal override: true components: clippy diff --git a/.github/workflows/rust-next.yml b/.github/workflows/rust-next.yml index bce29d1..6504b3f 100644 --- a/.github/workflows/rust-next.yml +++ b/.github/workflows/rust-next.yml @@ -57,9 +57,9 @@ jobs: strategy: matrix: rust: - - 1.54.0 # MSRV + - 1.60.0 # MSRV - stable - continue-on-error: ${{ matrix.rust != '1.54.0' }} # MSRV + continue-on-error: ${{ matrix.rust != '1.60.0' }} # MSRV runs-on: ubuntu-latest steps: - name: Checkout repository diff --git a/Cargo.toml b/Cargo.toml index f39d167..54e032f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,8 @@ documentation = "https://docs.rs/codegenres" readme = "README.md" categories = ["development-tools", "text-processing"] keywords = ["development", "codegen"] -edition = "2018" +edition = "2021" +rust-version = "1.60.0" # MSRV include = [ "src/**/*", "Cargo.toml",