From d8bfe10766c63df035287f16502eb2b5db1bf8b0 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Tue, 6 Aug 2024 05:26:24 +1000 Subject: [PATCH] Bump MSRV to Rust 1.63.0 As we have done in `rust-bitcoin` bump the MSVR to Rust 1.63.0 While we are at it and so that the commit lints cleanly fix a couple of new clippy warnings: - Remove redundant import of `TryFrom` - Use `then_some` combinator --- .github/workflows/rust.yml | 4 ++-- Cargo.toml | 3 ++- README.md | 4 ++-- clippy.toml | 2 +- fuzz/Cargo.toml | 2 +- fuzz/generate-files.sh | 2 +- src/plan.rs | 1 - src/primitives/threshold.rs | 4 ++-- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 033cc6d93..78ae54b62 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -54,7 +54,7 @@ jobs: run: ./maintainer-tools/ci/run_task.sh nightly MSRV: # 1 jobs, minimal lock file only. - name: Test - 1.56.1 toolchain + name: Test - 1.63.0 toolchain runs-on: ubuntu-latest strategy: fail-fast: false @@ -71,7 +71,7 @@ jobs: - name: "Select toolchain" uses: dtolnay/rust-toolchain@stable with: - toolchain: "1.56.1" + toolchain: "1.63.0" - name: "Set dependencies" run: cp Cargo-${{ matrix.dep }}.lock Cargo.lock - name: "Run test script" diff --git a/Cargo.toml b/Cargo.toml index 9fa86f8b0..8501ff6d3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,8 @@ repository = "https://github.com/rust-bitcoin/rust-miniscript/" description = "Miniscript: a subset of Bitcoin Script designed for analysis" keywords = [ "crypto", "bitcoin", "miniscript", "script" ] readme = "README.md" -edition = "2018" +edition = "2021" +rust-version = "1.63.0" [features] default = ["std"] diff --git a/README.md b/README.md index 9432b8962..6e638ff2a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ![Build](https://github.com/rust-bitcoin/rust-miniscript/workflows/Continuous%20integration/badge.svg) -**Minimum Supported Rust Version:** 1.56.1 +**Minimum Supported Rust Version:** 1.63.0 # Miniscript @@ -41,7 +41,7 @@ Enabling the `no-std` feature does not disable `std`. To disable the `std` featu ## Minimum Supported Rust Version (MSRV) -This library should always compile with any combination of features on **Rust 1.56.1**. +This library should always compile with any combination of features on **Rust 1.63.0**. Some dependencies do not play nicely with our MSRV, if you are running the tests you may need to pin some dependencies. See `./contrib/test.sh` for current pinning. diff --git a/clippy.toml b/clippy.toml index ab03a348e..2edc417d1 100644 --- a/clippy.toml +++ b/clippy.toml @@ -1,3 +1,3 @@ -msrv = "1.56.1" +msrv = "1.63.0" # plan API returns Self as an error type for an large-ish enum large-error-threshold = 256 diff --git a/fuzz/Cargo.toml b/fuzz/Cargo.toml index 9b3aeafca..353a9aa83 100644 --- a/fuzz/Cargo.toml +++ b/fuzz/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "descriptor-fuzz" edition = "2021" -rust-version = "1.56.1" +rust-version = "1.63.0" version = "0.0.1" authors = ["Generated by fuzz/generate-files.sh"] publish = false diff --git a/fuzz/generate-files.sh b/fuzz/generate-files.sh index 29f23d63e..8dabd7c9d 100755 --- a/fuzz/generate-files.sh +++ b/fuzz/generate-files.sh @@ -13,7 +13,7 @@ cat > "$REPO_DIR/fuzz/Cargo.toml" < Threshold { /// Constructs a threshold directly from a threshold value and collection. pub fn new(k: usize, inner: Vec) -> Result { if k == 0 || k > inner.len() || (MAX > 0 && inner.len() > MAX) { - Err(ThresholdError { k, n: inner.len(), max: (MAX > 0).then(|| MAX) }) + Err(ThresholdError { k, n: inner.len(), max: (MAX > 0).then_some(MAX) }) } else { Ok(Threshold { k, inner }) } @@ -68,7 +68,7 @@ impl Threshold { // Do an early return if our minimum size exceeds the max. if MAX > 0 && min_size > MAX { let n = iter.count(); - return Err(ThresholdError { k, n, max: (MAX > 0).then(|| MAX) }); + return Err(ThresholdError { k, n, max: (MAX > 0).then_some(MAX) }); } let mut inner = Vec::with_capacity(min_size);