From 985c9c059dfc372419c7c1f1eb574f03bcbe1c68 Mon Sep 17 00:00:00 2001 From: Piotr Czarnecki Date: Sun, 1 Dec 2024 21:24:49 +0100 Subject: [PATCH 1/7] Maintain README, github workflow, MSRV --- .github/workflows/rust.yml | 87 +++++++++++++++++++++++--------------- Cargo.toml | 1 + README.md | 2 +- crusader.sh | 11 ----- 4 files changed, 54 insertions(+), 47 deletions(-) delete mode 100755 crusader.sh diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index fa27d5b..1e0177a 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -13,19 +13,23 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Build run: cargo build --verbose - name: Run tests run: cargo test --verbose - - name: Run tests (gecko-ffi) - run: cargo test --tests --verbose + - name: Run miniserde tests + run: cargo test --features miniserde --verbose + - name: Run nanoserde tests + run: cargo test --features nanoserde --verbose + - name: Run borsh tests + run: cargo test --features borsh --verbose miri: name: "Miri" runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install Miri run: | rustup toolchain install nightly --component miri @@ -37,51 +41,64 @@ jobs: fmt: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@master with: toolchain: stable - profile: minimal components: rustfmt - override: true - - uses: actions-rs/cargo@v1 + - run: cargo fmt --all -- --check + + msrv: + name: Rust ${{matrix.rust}} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + rust: [1.0.0, 1.1.0] + timeout-minutes: 45 + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@master with: - command: fmt - args: --all -- --check - - + toolchain: ${{matrix.rust}} + - run: cargo build + - run: cargo test + + msrv-serde: + name: Rust ${{matrix.rust}} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + rust: [1.31.0, 1.32.0] + timeout-minutes: 45 + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{matrix.rust}} + - run: cargo build + - run: cargo test + - run: cargo test --features serde + clippy: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@master with: toolchain: stable - profile: minimal components: clippy - override: true - - uses: actions-rs/clippy-check@v1 - env: - PWD: ${{ env.GITHUB_WORKSPACE }} - with: - token: ${{ secrets.GITHUB_TOKEN }} - args: --workspace --tests --examples - - + - run: cargo clippy --workspace --tests --examples + docs: runs-on: ubuntu-latest env: RUSTDOCFLAGS: -Dwarnings steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@master with: toolchain: stable - profile: minimal - components: rust-docs - override: true - - uses: swatinem/rust-cache@v1 - - uses: actions-rs/cargo@v1 - with: - command: doc - args: --workspace --no-deps + - uses: swatinem/rust-cache@v2 + - run: cargo doc --workspace --no-deps diff --git a/Cargo.toml b/Cargo.toml index 1c443c5..66dc7a4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,6 +10,7 @@ documentation = "https://docs.rs/bit-vec/" keywords = ["data-structures", "bitvec", "bitmask", "bitmap", "bit"] readme = "README.md" edition = "2015" +rust-version = "1.0" [dependencies] borsh = { version = "1.5", default-features = false, features = ["derive"], optional = true } diff --git a/README.md b/README.md index 2d69953..304cc28 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ [crates.io link]: https://crates.io/crates/bit-vec [docs.rs badge]: https://docs.rs/bit-vec/badge.svg?version=0.8.0 [docs.rs link]: https://docs.rs/bit-vec/0.8.0/bit_vec/ -[github ci badge]: https://github.com/contain-rs/linked-hash-map/workflows/Rust/badge.svg?branch=master +[github ci badge]: https://github.com/contain-rs/bit-vec/workflows/Rust/badge.svg?branch=master [rustc 1.0+]: https://img.shields.io/badge/rustc-1.0%2B-blue.svg [serde_derive: rustc 1.31+]: https://img.shields.io/badge/serde_derive-rustc_1.31+-lightgray.svg [Rust 1.0]: https://blog.rust-lang.org/2015/05/15/Rust-1.0.html diff --git a/crusader.sh b/crusader.sh deleted file mode 100755 index 8becfed..0000000 --- a/crusader.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -git clone https://github.com/brson/cargo-crusader -cd cargo-crusader -cargo build --release -export PATH=$PATH:`pwd`/target/release/ -cd ../ - -cargo crusader - -exit From 67ae6df8a61a34bc678b0095a57878e7ff941986 Mon Sep 17 00:00:00 2001 From: Piotr Czarnecki Date: Sun, 8 Jun 2025 13:03:57 +0200 Subject: [PATCH 2/7] Bump MSRV to 1.60 --- .github/workflows/rust.yml | 25 ++++++++----------------- Cargo.toml | 10 +++++----- README.md | 8 ++------ benches/bench.rs | 5 +++-- 4 files changed, 18 insertions(+), 30 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 1e0177a..7a55f07 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -54,23 +54,7 @@ jobs: strategy: fail-fast: false matrix: - rust: [1.0.0, 1.1.0] - timeout-minutes: 45 - steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@master - with: - toolchain: ${{matrix.rust}} - - run: cargo build - - run: cargo test - - msrv-serde: - name: Rust ${{matrix.rust}} - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - rust: [1.31.0, 1.32.0] + rust: [1.60.0, 1.61.0] timeout-minutes: 45 steps: - uses: actions/checkout@v3 @@ -80,6 +64,9 @@ jobs: - run: cargo build - run: cargo test - run: cargo test --features serde + - run: cargo test --features nanoserde + - run: cargo test --features miniserde + - run: cargo test --features borsh clippy: runs-on: ubuntu-latest @@ -90,6 +77,10 @@ jobs: toolchain: stable components: clippy - run: cargo clippy --workspace --tests --examples + - run: cargo clippy --workspace --tests --examples --features serde + - run: cargo clippy --workspace --tests --examples --features miniserde + - run: cargo clippy --workspace --tests --examples --features nanoserde + - run: cargo clippy --workspace --tests --examples --features borsh docs: runs-on: ubuntu-latest diff --git a/Cargo.toml b/Cargo.toml index 66dc7a4..5114059 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,19 +9,19 @@ homepage = "https://github.com/contain-rs/bit-vec" documentation = "https://docs.rs/bit-vec/" keywords = ["data-structures", "bitvec", "bitmask", "bitmap", "bit"] readme = "README.md" -edition = "2015" -rust-version = "1.0" +edition = "2021" +rust-version = "1.60" [dependencies] borsh = { version = "1.5", default-features = false, features = ["derive"], optional = true } serde = { version = "1.0", default-features = false, features = ["derive"], optional = true } miniserde = { version = "0.1", optional = true } -nanoserde = { version = "0.1", optional = true } +nanoserde = { version = "0.2", optional = true } [dev-dependencies] serde_json = "1.0" -rand = "0.8" -rand_xorshift = "0.3" +rand = "0.9" +rand_xorshift = "0.4" [features] default = ["std"] diff --git a/README.md b/README.md index 304cc28..4c173cf 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,7 @@ [![crates.io][crates.io shield]][crates.io link] [![Documentation][docs.rs badge]][docs.rs link] ![Rust CI][github ci badge] -[![rustc 1.0+]][Rust 1.0] -[![serde_derive: rustc 1.31+]][Rust 1.31] +![MSRV][rustc 1.60+]

[![Dependency Status][deps.rs status]][deps.rs link] @@ -23,10 +22,7 @@ [docs.rs badge]: https://docs.rs/bit-vec/badge.svg?version=0.8.0 [docs.rs link]: https://docs.rs/bit-vec/0.8.0/bit_vec/ [github ci badge]: https://github.com/contain-rs/bit-vec/workflows/Rust/badge.svg?branch=master -[rustc 1.0+]: https://img.shields.io/badge/rustc-1.0%2B-blue.svg -[serde_derive: rustc 1.31+]: https://img.shields.io/badge/serde_derive-rustc_1.31+-lightgray.svg -[Rust 1.0]: https://blog.rust-lang.org/2015/05/15/Rust-1.0.html -[Rust 1.31]: https://blog.rust-lang.org/2018/12/06/Rust-1.31-and-rust-2018.html +[rustc 1.60+]: https://img.shields.io/badge/rustc-1.60%2B-blue.svg [deps.rs status]: https://deps.rs/crate/bit-vec/0.8.0/status.svg [deps.rs link]: https://deps.rs/crate/bit-vec/0.8.0 [shields.io download count]: https://img.shields.io/crates/d/bit-vec.svg diff --git a/benches/bench.rs b/benches/bench.rs index 871714e..88f1adf 100644 --- a/benches/bench.rs +++ b/benches/bench.rs @@ -8,6 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![allow(stable_features)] #![feature(test)] #![feature(hint_assert_unchecked)] @@ -26,7 +27,7 @@ const BENCH_BITS: usize = 1 << 14; const U32_BITS: usize = 32; fn small_rng() -> XorShiftRng { - XorShiftRng::from_entropy() + XorShiftRng::from_os_rng() } #[bench] @@ -59,7 +60,7 @@ fn bench_bit_set_big_variable(b: &mut Bencher) { let mut bit_vec = BitVec::from_elem(BENCH_BITS, false); b.iter(|| { for _ in 0..100 { - bit_vec.set((r.next_u32() as usize) % BENCH_BITS, r.gen()); + bit_vec.set((r.next_u32() as usize) % BENCH_BITS, r.random()); } black_box(&bit_vec); }); From 9800ec4bed4c6e5da69e962c55e4c988797822b3 Mon Sep 17 00:00:00 2001 From: Piotr Czarnecki Date: Sun, 8 Jun 2025 13:11:41 +0200 Subject: [PATCH 3/7] Fix version --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 7a55f07..df757b7 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -57,7 +57,7 @@ jobs: rust: [1.60.0, 1.61.0] timeout-minutes: 45 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master with: toolchain: ${{matrix.rust}} From 6a8712f7f886ab07e869caa4fd18c32e0068ae49 Mon Sep 17 00:00:00 2001 From: Piotr Czarnecki Date: Sun, 8 Jun 2025 13:15:10 +0200 Subject: [PATCH 4/7] Revert nanoserde version since it has high MSRV --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 5114059..347d9a2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,7 @@ rust-version = "1.60" borsh = { version = "1.5", default-features = false, features = ["derive"], optional = true } serde = { version = "1.0", default-features = false, features = ["derive"], optional = true } miniserde = { version = "0.1", optional = true } -nanoserde = { version = "0.2", optional = true } +nanoserde = { version = "0.1", optional = true } [dev-dependencies] serde_json = "1.0" From 75ba0ed3f2d6ca1408516a3d3e249dcb20696066 Mon Sep 17 00:00:00 2001 From: Piotr Czarnecki Date: Sun, 8 Jun 2025 13:20:42 +0200 Subject: [PATCH 5/7] Bump MSRV --- .github/workflows/rust.yml | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index df757b7..1d03c09 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -54,7 +54,7 @@ jobs: strategy: fail-fast: false matrix: - rust: [1.60.0, 1.61.0] + rust: [1.63.0, 1.64.0] timeout-minutes: 45 steps: - uses: actions/checkout@v4 diff --git a/Cargo.toml b/Cargo.toml index 347d9a2..1ece517 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ documentation = "https://docs.rs/bit-vec/" keywords = ["data-structures", "bitvec", "bitmask", "bitmap", "bit"] readme = "README.md" edition = "2021" -rust-version = "1.60" +rust-version = "1.63" [dependencies] borsh = { version = "1.5", default-features = false, features = ["derive"], optional = true } From 1296dc007b83832a33903413cd721bd6638c4edd Mon Sep 17 00:00:00 2001 From: Piotr Czarnecki Date: Sun, 8 Jun 2025 14:09:32 +0200 Subject: [PATCH 6/7] Bump MSRV because of let-else --- .github/workflows/rust.yml | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 1d03c09..f334eef 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -54,7 +54,7 @@ jobs: strategy: fail-fast: false matrix: - rust: [1.63.0, 1.64.0] + rust: [1.65.0, 1.66.0] timeout-minutes: 45 steps: - uses: actions/checkout@v4 diff --git a/Cargo.toml b/Cargo.toml index 1ece517..d68186b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ documentation = "https://docs.rs/bit-vec/" keywords = ["data-structures", "bitvec", "bitmask", "bitmap", "bit"] readme = "README.md" edition = "2021" -rust-version = "1.63" +rust-version = "1.65" [dependencies] borsh = { version = "1.5", default-features = false, features = ["derive"], optional = true } From aa5e638014ecbc97c6bb3d513ff68f340e4594dd Mon Sep 17 00:00:00 2001 From: Piotr Czarnecki Date: Sun, 8 Jun 2025 14:14:00 +0200 Subject: [PATCH 7/7] Update MSRV because of borsh --- .github/workflows/rust.yml | 2 +- Cargo.toml | 2 +- README.md | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index f334eef..de9266e 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -54,7 +54,7 @@ jobs: strategy: fail-fast: false matrix: - rust: [1.65.0, 1.66.0] + rust: [1.67.0, 1.68.0] timeout-minutes: 45 steps: - uses: actions/checkout@v4 diff --git a/Cargo.toml b/Cargo.toml index d68186b..cb520b5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ documentation = "https://docs.rs/bit-vec/" keywords = ["data-structures", "bitvec", "bitmask", "bitmap", "bit"] readme = "README.md" edition = "2021" -rust-version = "1.65" +rust-version = "1.67" [dependencies] borsh = { version = "1.5", default-features = false, features = ["derive"], optional = true } diff --git a/README.md b/README.md index 4c173cf..d7eb919 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ [![crates.io][crates.io shield]][crates.io link] [![Documentation][docs.rs badge]][docs.rs link] ![Rust CI][github ci badge] -![MSRV][rustc 1.60+] +![MSRV][rustc 1.67+]

[![Dependency Status][deps.rs status]][deps.rs link] @@ -22,7 +22,7 @@ [docs.rs badge]: https://docs.rs/bit-vec/badge.svg?version=0.8.0 [docs.rs link]: https://docs.rs/bit-vec/0.8.0/bit_vec/ [github ci badge]: https://github.com/contain-rs/bit-vec/workflows/Rust/badge.svg?branch=master -[rustc 1.60+]: https://img.shields.io/badge/rustc-1.60%2B-blue.svg +[rustc 1.67+]: https://img.shields.io/badge/rustc-1.67%2B-blue.svg [deps.rs status]: https://deps.rs/crate/bit-vec/0.8.0/status.svg [deps.rs link]: https://deps.rs/crate/bit-vec/0.8.0 [shields.io download count]: https://img.shields.io/crates/d/bit-vec.svg