Skip to content

Commit fae9da1

Browse files
connortsui20claude
andauthored
chore: tidy up a few compile-time assertions (vortex-data#9158)
Uses `const { assert!(..) }` for the function-body assertion in `build_views` to match the existing const-block sites, removes a redundant block around the single `assert!` in `vortex-error`, and corrects a doc comment that claimed `DType` is 16 bytes while the assertion below it checked for 24. Signed-off-by: Connor <connor@spiraldb.com> Co-authored-by: Claude <noreply@anthropic.com>
1 parent 2de0319 commit fae9da1

3 files changed

Lines changed: 3 additions & 5 deletions

File tree

vortex-array/src/arrays/varbinview/build_views.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ mod tests {
230230
const N: usize = 9000;
231231
const LEN: usize = 1000;
232232
// The final offset is (N - 1) * LEN, which must exceed 2^23 to be a meaningful check.
233-
const _: () = assert!((N - 1) * LEN > (1 << 23));
233+
const { assert!((N - 1) * LEN > (1 << 23)) };
234234

235235
let values: Vec<Vec<u8>> = (0..N)
236236
.map(|i| {

vortex-array/src/dtype/dtype_impl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ pub trait NativeDType {
3535
fn dtype() -> DType;
3636
}
3737

38-
/// Assert that the size of DType is 16 bytes.
38+
/// Assert that the size of DType is 24 bytes.
3939
#[cfg(not(target_arch = "wasm32"))]
4040
const _: [(); size_of::<DType>()] = [(); 24]; // FIXME(ngates): should we keep this at 16?
4141

vortex-error/src/lib.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,7 @@ impl From<Infallible> for VortexError {
7979
}
8080
}
8181

82-
const _: () = {
83-
assert!(size_of::<VortexError>() < 128);
84-
};
82+
const _: () = assert!(size_of::<VortexError>() < 128);
8583

8684
/// The top-level error type for Vortex.
8785
#[non_exhaustive]

0 commit comments

Comments
 (0)