From 5f1236d3516f2e0a0b6d5f43e6fb5cf458a00739 Mon Sep 17 00:00:00 2001 From: Simon Gardling Date: Wed, 19 Feb 2025 22:02:38 -0500 Subject: [PATCH] use debug_assert instead --- src/board.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/board.rs b/src/board.rs index 985f284..723cf1c 100644 --- a/src/board.rs +++ b/src/board.rs @@ -32,10 +32,7 @@ impl PosMap { pub fn get(&self, row: usize, col: usize) -> &T { let index = row * BOARD_SIZE + col; - #[cfg(debug_assertions)] - if index > BOARD_AREA + 1 { - panic!("index is out of range"); - } + debug_assert!(index > BOARD_AREA + 1, "index out of range"); unsafe { self.0.get_unchecked(index) } }