Skip to content

Commit c4220e8

Browse files
committed
rename as_primitive -> cast
Signed-off-by: Joe Isaacs <[email protected]>
1 parent 4d949e9 commit c4220e8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

vortex-scalar/src/primitive.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ impl<'a> PrimitiveScalar<'a> {
546546
#[cfg(test)]
547547
#[allow(clippy::cast_possible_truncation)]
548548
mod tests {
549-
use num_traits::CheckedSub;
549+
use num_traits::{CheckedSub, FromPrimitive};
550550
use rstest::rstest;
551551
use vortex_dtype::{DType, Nullability, PType};
552552

@@ -996,8 +996,8 @@ mod tests {
996996
assert!(f64::from_f16(f16_val).is_some());
997997

998998
// Test f16 to integer conversion (should fail)
999-
assert!(i32::from_f16(f16_val).is_none());
1000-
assert!(u32::from_f16(f16_val).is_none());
999+
assert!(i32::try_from(PValue::from(f16_val)).is_err());
1000+
assert!(u32::try_from(PValue::from(f16_val)).is_err());
10011001
}
10021002

10031003
#[test]

0 commit comments

Comments
 (0)