diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2293e49..90968f0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,30 +12,32 @@ env: CARGO_INCREMENTAL: 0 RUST_BACKTRACE: 1 # Faster crates.io index checkout. - # Enable once the MSRV is >= 1.68 - #CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse + CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse RUST_LOG: debug jobs: check_clippy: -# runs-on: ubuntu-24.04 - runs-on: self-hosted + runs-on: ubuntu-24.04 name: Clippy steps: - uses: actions/checkout@v4 - name: Run cargo clippy - run: cargo clippy --workspace --all-features -- -D warnings + run: | + rustup component add clippy + cargo clippy --workspace --all-features -- -D warnings check_fmt: - runs-on: self-hosted + runs-on: ubuntu-24.04 name: Checking fmt steps: - uses: actions/checkout@v4 - name: Run cargo fmt - run: cargo fmt --all -- --check + run: | + rustup component add rustfmt + cargo fmt --all -- --check rustdoc: - runs-on: self-hosted + runs-on: ubuntu-24.04 name: Rustdoc steps: - uses: actions/checkout@v4 @@ -43,7 +45,7 @@ jobs: run: cargo rustdoc --all-features -- -D warnings build: - runs-on: self-hosted + runs-on: ubuntu-24.04 name: Release build steps: - uses: actions/checkout@v4 @@ -51,7 +53,7 @@ jobs: run: cargo build --release benches: - runs-on: self-hosted + runs-on: ubuntu-24.04 name: Run benchmarks steps: - uses: actions/checkout@v4 @@ -59,7 +61,7 @@ jobs: run: cargo bench --all-targets test: - runs-on: self-hosted + runs-on: ubuntu-24.04 name: Run cargo test strategy: matrix: diff --git a/rust-toolchain b/rust-toolchain index 0403bed..68bc7ff 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -1.66.1 +1.71.1 diff --git a/src/hash_impl.rs b/src/hash_impl.rs index 5eec9b1..3b5f668 100644 --- a/src/hash_impl.rs +++ b/src/hash_impl.rs @@ -43,7 +43,7 @@ impl Hashable for [u8; N] { #[allow(trivial_casts, unsafe_code)] fn hash_slice(data: &[[u8; N]], state: &mut H) { - let newlen = data.len() * mem::size_of::<[u8; N]>(); + let newlen = mem::size_of_val(data); let ptr = data.as_ptr() as *const u8; state.write(unsafe { slice::from_raw_parts(ptr, newlen) }) } diff --git a/src/merkle.rs b/src/merkle.rs index ba17492..4e89b40 100644 --- a/src/merkle.rs +++ b/src/merkle.rs @@ -1629,7 +1629,7 @@ impl< let mut data = S::new(size).expect("failed to create data store"); - populate_data_par::(&mut data, iter)?; + populate_data_par::(&mut data, iter)?; let root = S::build::(&mut data, leafs, row_count, None)?; Ok(MerkleTree { @@ -1689,7 +1689,7 @@ impl< }); } - populate_data_par::(&mut data, iter)?; + populate_data_par::(&mut data, iter)?; let root = S::build::(&mut data, leafs, row_count, Some(config))?; Ok(MerkleTree { @@ -2049,12 +2049,11 @@ pub fn populate_data< Ok(()) } -fn populate_data_par(data: &mut S, iter: I) -> Result<()> +fn populate_data_par(data: &mut S, iter: I) -> Result<()> where E: Element, A: Algorithm, S: Store, - BaseTreeArity: Unsigned, I: ParallelIterator + IndexedParallelIterator, { if !data.is_empty() {