diff options
author | Vincent Ambo <mail@tazj.in> | 2023-02-26T15·22+0300 |
---|---|---|
committer | clbot <clbot@tvl.fyi> | 2023-03-03T11·01+0000 |
commit | 344c1193700370f4762ae709c076aae11ca50b18 (patch) | |
tree | 932bba9a369c7e2feb82aef4671fa6b2fae04267 /tvix/eval/src/value/mod.rs | |
parent | 7e9a65dcdb38c247f742a181a94a452df6802fbb (diff) |
chore(tvix/eval): fix clippy warnings r/5870
Change-Id: I4c02f0104c455ac00a3f299c1fbf75cbb08e8972 Reviewed-on: https://cl.tvl.fyi/c/depot/+/8142 Reviewed-by: flokli <flokli@flokli.de> Tested-by: BuildkiteCI Autosubmit: tazjin <tazjin@tvl.su>
Diffstat (limited to 'tvix/eval/src/value/mod.rs')
-rw-r--r-- | tvix/eval/src/value/mod.rs | 8 |
1 files changed, 4 insertions, 4 deletions
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<F: std::fmt::Write>(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::<f64, { CXX_LITERAL }>( - num.clone(), + num, &mut buf, &WRITE_FLOAT_OPTIONS, ); @@ -566,7 +566,7 @@ fn total_fmt_float<F: std::fmt::Write>(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<F: std::fmt::Write>(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(); |