From 344c1193700370f4762ae709c076aae11ca50b18 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 26 Feb 2023 18:22:08 +0300 Subject: chore(tvix/eval): fix clippy warnings Change-Id: I4c02f0104c455ac00a3f299c1fbf75cbb08e8972 Reviewed-on: https://cl.tvl.fyi/c/depot/+/8142 Reviewed-by: flokli Tested-by: BuildkiteCI Autosubmit: tazjin --- tvix/eval/src/value/mod.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tvix/eval/src/value/mod.rs') diff --git a/tvix/eval/src/value/mod.rs b/tvix/eval/src/value/mod.rs index 8b0b75e8668a..ede93e7dddd2 100644 --- a/tvix/eval/src/value/mod.rs +++ b/tvix/eval/src/value/mod.rs @@ -521,7 +521,7 @@ impl Display for Value { fn total_fmt_float(num: f64, mut f: F) -> std::fmt::Result { let mut buf = [b'0'; lexical_core::BUFFER_SIZE]; let mut s = lexical_core::write_with_options::( - num.clone(), + num, &mut buf, &WRITE_FLOAT_OPTIONS, ); @@ -566,7 +566,7 @@ fn total_fmt_float(num: f64, mut f: F) -> std::fmt::Result { if c == &b'.' { // trim zeroes from the right side. let frac = String::from_utf8_lossy(&s[i + 1..]); - let frac_no_trailing_zeroes = frac.trim_end_matches("0"); + let frac_no_trailing_zeroes = frac.trim_end_matches('0'); if frac.len() != frac_no_trailing_zeroes.len() { // we managed to strip something, construct new_s @@ -587,7 +587,7 @@ fn total_fmt_float(num: f64, mut f: F) -> std::fmt::Result { } } - write!(f, "{}", format!("{}", String::from_utf8_lossy(&s))) + write!(f, "{}", format!("{}", String::from_utf8_lossy(s))) } impl TotalDisplay for Value { @@ -671,7 +671,7 @@ mod tests { (1e6, "1e+06"), (-2E-2, "-0.02"), (6.626e-34, "6.626e-34"), - (9_224_617.445_991_228_313, "9.22462e+06"), + (9_224_617.445_991_227, "9.22462e+06"), ]; for (n, expected) in ff.iter() { let mut buf = String::new(); -- cgit 1.4.1