Skip to content

Commit

Permalink
Use assert_eq instead of debug_assert_eq
Browse files Browse the repository at this point in the history
  • Loading branch information
cschwan committed Apr 25, 2024
1 parent cac8915 commit ca8f09c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pineappl/src/packed_array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ impl<T: Copy + Default + PartialEq, const D: usize> Index<[usize; D]> for Packed
type Output = T;

fn index(&self, index: [usize; D]) -> &Self::Output {
debug_assert_eq!(index.len(), self.shape.len());
assert_eq!(index.len(), self.shape.len());
assert!(
index.iter().zip(self.shape.iter()).all(|(&i, &d)| i < d),
"index {:?} is out of bounds for array of shape {:?}",
Expand Down Expand Up @@ -176,7 +176,7 @@ impl<T: Clone + Copy + Default + PartialEq, const D: usize> IndexMut<[usize; D]>
for PackedArray<T, D>
{
fn index_mut(&mut self, index: [usize; D]) -> &mut Self::Output {
debug_assert_eq!(index.len(), self.shape.len());
assert_eq!(index.len(), self.shape.len());
assert!(
index.iter().zip(self.shape.iter()).all(|(&i, &d)| i < d),
"index {:?} is out of bounds for array of shape {:?}",
Expand Down

0 comments on commit ca8f09c

Please sign in to comment.