read is used here:
|
let block = unsafe { block_ptr.read() }.from_le(); |
However the alignment hasn't been verified prior to this. It so happens that FixedSizeBlock is (currently) only implemented on repr(packed) structs (which have 1-byte alignment), however the alignment should still be verified or read_unaligned should be used.
If these should always be repr(packed), maybe add an assert_eq!(std::mem::align_of::<Self>(), 1)?
readis used here:zip2/src/spec.rs
Line 112 in ad111aa
However the alignment hasn't been verified prior to this. It so happens that
FixedSizeBlockis (currently) only implemented onrepr(packed)structs (which have 1-byte alignment), however the alignment should still be verified orread_unalignedshould be used.If these should always be
repr(packed), maybe add anassert_eq!(std::mem::align_of::<Self>(), 1)?