Skip to content

Commit 410a30e

Browse files
committed
chore: Clearer assertions
1 parent a4be496 commit 410a30e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/internals/cast.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,16 @@ pub struct BytesAsReparseDataBuffer {
1010
value: Box<[MaybeU8; MAXIMUM_REPARSE_DATA_BUFFER_SIZE as usize]>,
1111
}
1212

13+
// Asserts that pointers of `BytesAsReparseDataBuffer` can be casted to
14+
// `REPARSE_DATA_BUFFER`.
1315
const _: () = {
1416
let a = align_of::<BytesAsReparseDataBuffer>();
1517
let b = align_of::<REPARSE_DATA_BUFFER>();
16-
[(); 1][!((a % b) == 0) as usize]
18+
assert!((a % b) == 0);
1719
};
1820

1921
impl BytesAsReparseDataBuffer {
22+
// MSRV(1.82): Use `Box::new_uninit_slice` instead.
2023
pub fn new() -> Self {
2124
type Raw = [MaybeU8; MAXIMUM_REPARSE_DATA_BUFFER_SIZE as usize];
2225
const LAYOUT: Layout = Layout::new::<Raw>();

0 commit comments

Comments
 (0)