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
|
// Convert chars to string for TOML map; insert into BTreeMap to be sorted
|
||||||
let ordered: BTreeMap<_, _> = value
|
let ordered: BTreeMap<_, _> = value
|
||||||
.iter()
|
.iter()
|
||||||
.map(|(key, t)| (String::from(*key), t.clone()))
|
.map(|(key, t)| (String::from(*key), t))
|
||||||
.collect();
|
.collect();
|
||||||
ordered.serialize(serializer)
|
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;
|
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)
|
// 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..]
|
&num_str[1..]
|
||||||
} else {
|
} else {
|
||||||
num_str
|
num_str
|
||||||
@ -474,7 +474,7 @@ fn fmt_separated(f: f64, sep: char) -> String {
|
|||||||
for i in 0..((end - start - 1).div_euclid(3)) {
|
for i in 0..((end - start - 1).div_euclid(3)) {
|
||||||
ret.insert(end - (i + 1) * 3, sep);
|
ret.insert(end - (i + 1) * 3, sep);
|
||||||
}
|
}
|
||||||
format!("{}", ret)
|
ret
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
Loading…
Reference in New Issue
Block a user