Skip to content

Commit

Permalink
fix option handling
Browse files Browse the repository at this point in the history
  • Loading branch information
c-peters committed Aug 24, 2023
1 parent 51675b1 commit 11ff7c2
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions crates/polars-arrow/src/compute/decimal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,9 @@ fn split_decimal_bytes(bytes: &[u8]) -> (Option<&[u8]>, Option<&[u8]>) {
(lhs, rhs)
}

fn parse_integer_checked(bytes: &[u8]) -> Option<i128>{
let (n,len) = i128::from_radix_10_signed_checked(bytes);
match n {
Some(i) if len == bytes.len() => Some(i),
_ => None
}
fn parse_integer_checked(bytes: &[u8]) -> Option<i128> {
let (n, len) = i128::from_radix_10_signed_checked(bytes);
n.filter(|_| len == bytes.len())
}

pub fn infer_scale(bytes: &[u8]) -> Option<u8> {
Expand Down

0 comments on commit 11ff7c2

Please sign in to comment.