diff --git a/.github/workflows/hybrid-array.yml b/.github/workflows/hybrid-array.yml index bf0b046..7d280ef 100644 --- a/.github/workflows/hybrid-array.yml +++ b/.github/workflows/hybrid-array.yml @@ -37,7 +37,7 @@ jobs: toolchain: ${{ matrix.rust }} targets: ${{ matrix.target }} - uses: RustCrypto/actions/cargo-hack-install@master - - run: cargo hack build --target ${{ matrix.target }} --feature-powerset --exclude-all-features --optional-deps bytemuck,serde,subtle,zeroize + - run: cargo hack build --target ${{ matrix.target }} --feature-powerset --exclude-all-features --optional-deps bytemuck,serde,subtle,zeroize,wincode careful: runs-on: ubuntu-latest diff --git a/Cargo.toml b/Cargo.toml index b0fcd67..0a5dc77 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,7 +18,6 @@ rust-version = "1.85" [dependencies] typenum = { version = "1.17", features = ["const-generics"] } -wincode = { version = "0.2.5" } # optional dependencies arbitrary = { version = "1", optional = true } @@ -26,12 +25,12 @@ bytemuck = { version = "1", optional = true, default-features = false } serde = { version = "1", optional = true, default-features = false } subtle = { version = "2", optional = true, default-features = false, features = ["const-generics"] } zeroize = { version = "1.8", optional = true, default-features = false } +wincode = { version = "0.2.5", optional = true, default-features = false } [features] alloc = [] extra-sizes = [] -wincode = [] - +wincode = ["dep:wincode"] [package.metadata.docs.rs] all-features = true diff --git a/src/wincode.rs b/src/wincode.rs index dc66e5f..257abf4 100644 --- a/src/wincode.rs +++ b/src/wincode.rs @@ -86,7 +86,7 @@ where let mut guard = SliceDropGuard::::new(base); if let TypeMeta::Static { size, .. } = Self::TYPE_META { // SAFETY: `Self::TYPE_META` specifies a static size, which is `U::USIZE * static_size_of(T)`. - // `U::USIZE reads of `T` will consume `size` bytes, fully consuming the trusted window. + // `U::USIZE` reads of `T` will consume `size` bytes, fully consuming the trusted window. let reader = &mut unsafe { reader.as_trusted_for(size) }?; for i in 0..U::USIZE { let slot = unsafe { &mut *base.add(i) };