From 52b3fbc04ab867778931f2a6e5061b8e1b15b681 Mon Sep 17 00:00:00 2001 From: KodrAus Date: Wed, 18 Oct 2023 06:53:50 +1000 Subject: [PATCH 1/2] replace MIPS with Miri and add clippy to CI --- .github/workflows/ci.yml | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b75d64a2..3b86f1f4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -68,7 +68,7 @@ jobs: run: cargo hack test --lib --all-features stable: - name: "Tests / Stable" + name: Tests / Stable runs-on: ubuntu-latest steps: - name: Checkout sources @@ -78,7 +78,7 @@ jobs: run: cargo test --all-features msrv: - name: "Build / MSRV" + name: Build / MSRV runs-on: ubuntu-latest steps: - name: Checkout sources @@ -134,18 +134,38 @@ jobs: - name: Fast RNG run: cargo test --target wasm32-wasi --features "v4 fast-rng" - mips: - name: Tests / MIPS (Big Endian) + miri: + name: Tests / Miri runs-on: ubuntu-latest steps: - name: Checkout sources uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab - - name: Install Cross - run: cargo install cross + - name: Install Miri + run: | + rustup toolchain install nightly --component miri + cargo +nightly miri setup - name: Default features - run: cross test --target mips-unknown-linux-gnu + run: cargo +nightly miri test + + - name: BE + run: cargo +nightly miri test --target s390x-unknown-linux-gnu + + clippy: + name: Build / Clippy + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab + + - name: Install Clippy + run: | + rustup update beta + rustup component add clippy --toolchain beta + + - name: Default features + run: cargo +beta clippy --all-features embedded: name: Build / Embedded From 0c5b2dfebdbfc950ddd5d69900d814dabce5f754 Mon Sep 17 00:00:00 2001 From: KodrAus Date: Wed, 18 Oct 2023 07:00:00 +1000 Subject: [PATCH 2/2] fix up a clippy warning --- src/timestamp.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/timestamp.rs b/src/timestamp.rs index 550b81bd..2e2045e0 100644 --- a/src/timestamp.rs +++ b/src/timestamp.rs @@ -145,11 +145,9 @@ impl Timestamp { #[cfg(any(feature = "v1", feature = "v6"))] const fn unix_to_rfc4122_ticks(seconds: u64, nanos: u32) -> u64 { - let ticks = UUID_TICKS_BETWEEN_EPOCHS + UUID_TICKS_BETWEEN_EPOCHS .wrapping_add(seconds.wrapping_mul(10_000_000)) - .wrapping_add(nanos as u64 / 100); - - ticks + .wrapping_add(nanos as u64 / 100) } const fn rfc4122_to_unix(ticks: u64) -> (u64, u32) {