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
2 changes: 1 addition & 1 deletion .github/workflows/hybrid-array.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,19 @@ rust-version = "1.85"

[dependencies]
typenum = { version = "1.17", features = ["const-generics"] }
wincode = { version = "0.2.5" }

# optional dependencies
arbitrary = { version = "1", optional = true }
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
2 changes: 1 addition & 1 deletion src/wincode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ where
let mut guard = SliceDropGuard::<T::Dst>::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) };
Expand Down