From ebf6ada9399656a5e4cc39a7b839fa1d63d2f52c Mon Sep 17 00:00:00 2001 From: Louis-Marie Baer Date: Thu, 30 May 2024 23:01:26 +0200 Subject: [PATCH] apply clippy tips --- src/main.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index 85fa8a0..6a10ae6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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 { @@ -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()); } @@ -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()); }