Skip to content

Commit

Permalink
use usize_as
Browse files Browse the repository at this point in the history
  • Loading branch information
2010YOUY01 committed Sep 7, 2024
1 parent eae8d7e commit 3e75f48
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions datafusion/functions/src/unicode/character_length.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,9 @@ where
.map(|string| {
string.map(|string: &str| {
if is_array_ascii_only {
T::Native::from_usize(string.len()).expect(
"should not fail as string.len will always return integer",
)
T::Native::usize_as(string.len())
} else {
T::Native::from_usize(string.chars().count()).expect(
"should not fail as string.chars will always return integer",
)
T::Native::usize_as(string.chars().count())
}
})
})
Expand Down

0 comments on commit 3e75f48

Please sign in to comment.