Skip to content

Commit 169dad8

Browse files
committed
fix(callcenter::role_keys): const { assert!() } for const-only invariant (clippy::assertions_on_constants)
CI clippy (`-D warnings`) caught a const-only `assert!` on the SAVANT_SLICE_END <= VSA_DIMS invariant inside the `savant_zone_fits_in_smb_headroom` test. Both operands are compile-time constants, so the right shape is `const { assert!(..) }` — compile-time check, no runtime work, no lint. Lines 170-172 (SUBJECT_KEY.slice_end ≤ SAVANT_SLICE_START etc.) use the same pattern but aren't flagged by clippy 1.95 (struct field accesses on const RoleKey values aren't const-evaluated by this lint); leaving them as runtime asserts pending future clippy upgrade. https://claude.ai/code/session_017gZ6sPRXYPj5n7uJ7NBtRv
1 parent d8d7d43 commit 169dad8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

crates/lance-graph-contract/src/callcenter/role_keys.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ mod tests {
120120
// [14_096 .. 16_384) (= 2288 dims) as headroom. We claim 2250 of
121121
// those 2288 dims; 38 remain.
122122
assert_eq!(SAVANT_SLICE_END, 16_346);
123-
assert!(SAVANT_SLICE_END <= VSA_DIMS);
123+
const { assert!(SAVANT_SLICE_END <= VSA_DIMS) };
124124
assert_eq!(VSA_DIMS - SAVANT_SLICE_END, 38, "headroom remaining");
125125
}
126126

0 commit comments

Comments
 (0)