Skip to content

Commit

Permalink
Scalar Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
gatesn committed May 8, 2024
1 parent d43e617 commit 4f4fcbe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions vortex-scalar/src/primitive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,11 @@ impl TryFrom<&Scalar> for usize {
type Error = VortexError;

fn try_from(value: &Scalar) -> Result<Self, Self::Error> {
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)
}
}
2 changes: 1 addition & 1 deletion vortex-scalar/src/utf8.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()?,
})
}
Expand Down

0 comments on commit 4f4fcbe

Please sign in to comment.