From 4f4fcbe5e016db4de00e607403408aeca5321481 Mon Sep 17 00:00:00 2001 From: Nicholas Gates Date: Wed, 8 May 2024 09:56:13 +0100 Subject: [PATCH] Scalar Refactor --- vortex-scalar/src/primitive.rs | 4 ++-- vortex-scalar/src/utf8.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/vortex-scalar/src/primitive.rs b/vortex-scalar/src/primitive.rs index 58d76f5419..9eef4da6b4 100644 --- a/vortex-scalar/src/primitive.rs +++ b/vortex-scalar/src/primitive.rs @@ -141,11 +141,11 @@ impl TryFrom<&Scalar> for usize { type Error = VortexError; fn try_from(value: &Scalar) -> Result { - Ok(u64::try_from( + u64::try_from( value .cast(&DType::Primitive(PType::U64, Nullability::NonNullable))? .as_ref(), ) - .map(|v| v as usize)?) + .map(|v| v as usize) } } diff --git a/vortex-scalar/src/utf8.rs b/vortex-scalar/src/utf8.rs index 0bc4eb4341..01a2093364 100644 --- a/vortex-scalar/src/utf8.rs +++ b/vortex-scalar/src/utf8.rs @@ -51,7 +51,7 @@ impl<'a> TryFrom<&'a Scalar> for Utf8Scalar<'a> { value: value .value .as_bytes()? - .map(|b| BufferString::try_from(b)) + .map(BufferString::try_from) .transpose()?, }) }