Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 43 additions & 35 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -37,51 +41,55 @@ 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.67.0, 1.68.0]
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
command: fmt
args: --all -- --check


toolchain: ${{matrix.rust}}
- 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
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
- 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
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
7 changes: 4 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ 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"
edition = "2021"
rust-version = "1.67"

[dependencies]
borsh = { version = "1.5", default-features = false, features = ["derive"], optional = true }
Expand All @@ -19,8 +20,8 @@ nanoserde = { version = "0.1", 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"]
Expand Down
10 changes: 3 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.67+]
<br />
<br />
[![Dependency Status][deps.rs status]][deps.rs link]
Expand All @@ -22,11 +21,8 @@
[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
[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
[github ci badge]: https://github.com/contain-rs/bit-vec/workflows/Rust/badge.svg?branch=master
[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
Expand Down
5 changes: 3 additions & 2 deletions benches/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]

Expand All @@ -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]
Expand Down Expand Up @@ -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);
});
Expand Down
11 changes: 0 additions & 11 deletions crusader.sh

This file was deleted.