From aea77dd3fc29364eac197fada05a5ada7a4f6bf8 Mon Sep 17 00:00:00 2001 From: Austen Adler Date: Thu, 13 May 2021 23:05:56 -0400 Subject: [PATCH] Make clippy changes --- src/calc.rs | 2 +- src/main.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/calc.rs b/src/calc.rs index 6749971..1e0d547 100644 --- a/src/calc.rs +++ b/src/calc.rs @@ -65,7 +65,7 @@ where // Convert chars to string for TOML map; insert into BTreeMap to be sorted let ordered: BTreeMap<_, _> = value .iter() - .map(|(key, t)| (String::from(*key), t.clone())) + .map(|(key, t)| (String::from(*key), t)) .collect(); ordered.serialize(serializer) } diff --git a/src/main.rs b/src/main.rs index 4e6732e..bd1bb89 100644 --- a/src/main.rs +++ b/src/main.rs @@ -444,7 +444,7 @@ fn fmt_engineering(f: f64, precision: usize) -> String { let num_whole_digits = exp.rem_euclid(3) as usize + 1; // If this is a negative number, strip off the added space, otherwise keep the space (and next digit) - let num_str = if let Some(_) = num_str.strip_prefix(" -") { + let num_str = if num_str.strip_prefix(" -").is_some() { &num_str[1..] } else { num_str @@ -474,7 +474,7 @@ fn fmt_separated(f: f64, sep: char) -> String { for i in 0..((end - start - 1).div_euclid(3)) { ret.insert(end - (i + 1) * 3, sep); } - format!("{}", ret) + ret } #[cfg(test)]