Skip to content

Commit 7e43d02

Browse files
committed
simpler
Signed-off-by: Robert Kruszewski <github@robertk.io>
1 parent 65017d9 commit 7e43d02

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

vortex-array/src/arrays/assertions.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
use std::fmt::Display;
55

66
use itertools::Itertools;
7+
use vortex_error::VortexExpect;
78

89
use crate::ArrayRef;
910
use crate::DynArray;
@@ -21,12 +22,13 @@ fn format_indices<I: IntoIterator<Item = usize>>(indices: I) -> impl Display {
2122
fn execute_to_canonical(array: ArrayRef, ctx: &mut ExecutionCtx) -> ArrayRef {
2223
array
2324
.execute::<RecursiveCanonical>(ctx)
24-
.expect("failed to execute array to recursive canonical form")
25+
.vortex_expect("failed to execute array to recursive canonical form")
2526
.0
2627
.into_array()
2728
}
2829

2930
/// Finds indices where two arrays differ based on `scalar_at` comparison.
31+
#[expect(clippy::unwrap_used)]
3032
fn find_mismatched_indices(left: &ArrayRef, right: &ArrayRef) -> Vec<usize> {
3133
assert_eq!(left.len(), right.len());
3234
(0..left.len())
@@ -74,6 +76,8 @@ macro_rules! assert_nth_scalar_is_null {
7476
#[macro_export]
7577
macro_rules! assert_arrays_eq {
7678
($left:expr, $right:expr) => {{
79+
let left = $left.clone();
80+
let right = $right.clone();
7781
assert_eq!(
7882
left.dtype(),
7983
right.dtype(),
@@ -95,9 +99,9 @@ macro_rules! assert_arrays_eq {
9599
);
96100

97101
#[allow(deprecated)]
98-
let left = $left.to_array();
102+
let left = left.to_array();
99103
#[allow(deprecated)]
100-
let right = $right.to_array();
104+
let right = right.to_array();
101105
$crate::arrays::assert_arrays_eq_impl(&left, &right);
102106
}};
103107
}

0 commit comments

Comments
 (0)