Skip to content

Commit

Permalink
apply clippy tips
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyrix126 committed May 30, 2024
1 parent 919be5f commit ebf6ada
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ fn format_json_fields_into_readable_output(json: Value) -> Value {
let mut nb = n.as_f64().unwrap();
debug!(" f64 nb was: {}", nb);
if nb.abs() >= BIG_NUMBER_DIGIT {
nb = nb / BIG_NUMBER_DIGIT;
nb /= BIG_NUMBER_DIGIT;
debug!(" f64 nb is now: {}", nb);
}
} else {
Expand All @@ -140,8 +140,8 @@ fn format_json_fields_into_readable_output(json: Value) -> Value {
if #[cfg(feature="reduce-big-numbers")] {
let mut nb = n.as_i64().unwrap() as f64;
debug!(" i64 nb was: {}", nb);
if nb.abs() as f64 >= BIG_NUMBER_DIGIT {
nb = nb / BIG_NUMBER_DIGIT;
if nb.abs() >= BIG_NUMBER_DIGIT {
nb /= BIG_NUMBER_DIGIT;
debug!(" i64 nb is now: {}", nb);
return Value::String(readable::num::Float::from(nb).to_string());
}
Expand All @@ -157,7 +157,7 @@ fn format_json_fields_into_readable_output(json: Value) -> Value {
let mut nb = n.as_u64().unwrap() as f64;
debug!("f64 nb was: {}", nb);
if nb >= BIG_NUMBER_DIGIT {
nb = nb / BIG_NUMBER_DIGIT;
nb /= BIG_NUMBER_DIGIT;
debug!("f64 nb is now: {}", nb);
return Value::String(readable::num::Float::from(nb).to_string());
}
Expand Down

0 comments on commit ebf6ada

Please sign in to comment.