Make clippy changes
This commit is contained in:
parent
f9f26f1ca7
commit
aea77dd3fc
@ -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)
|
||||
}
|
||||
|
@ -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)]
|
||||
|
Loading…
Reference in New Issue
Block a user