Skip to content

Commit

Permalink
fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
Weijun-H committed Sep 7, 2023
1 parent c504526 commit 1cf848b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion arrow-json/src/reader/primitive_array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,13 @@ macro_rules! primitive_parse {
$(impl ParseJsonNumber for $t {
fn parse(s: &[u8]) -> Option<Self> {
match std::str::from_utf8(s) {
Ok(s) => s.to_string().parse::<$t>().ok(),
Ok(s) => {
if let Ok(res) = s.to_string().parse::<$t>() {
Some(res)
} else {
return s.to_string().parse::<f64>().ok().and_then(NumCast::from)
}
}
Err(_) => None,
}
}
Expand Down

0 comments on commit 1cf848b

Please sign in to comment.