Fix clippy::redundant_clone lint violations (#36558)
This removes around 900 unnecessary clones, ranging from cloning a few ints all the way to large data structures and images. A lot of these were fixed using `cargo clippy --fix --workspace --all-targets`, however it often breaks other lints and needs to be run again. This was then followed up with some manual fixing. I understand this is a large diff, but all the changes are pretty trivial. Rust is doing some heavy lifting here for us. Once I get it up to speed with main, I'd appreciate this getting merged rather sooner than later. Release Notes: - N/A
This commit is contained in:
@@ -159,7 +159,6 @@ fn distance_string(
|
||||
} else {
|
||||
format!("about {} hours", hours)
|
||||
}
|
||||
.to_string()
|
||||
} else if distance < 172_800 {
|
||||
"1 day".to_string()
|
||||
} else if distance < 2_592_000 {
|
||||
@@ -206,21 +205,16 @@ fn distance_string(
|
||||
} else {
|
||||
format!("about {} years", years)
|
||||
}
|
||||
.to_string()
|
||||
} else if remaining_months < 9 {
|
||||
if hide_prefix {
|
||||
format!("{} years", years)
|
||||
} else {
|
||||
format!("over {} years", years)
|
||||
}
|
||||
.to_string()
|
||||
} else if hide_prefix {
|
||||
format!("{} years", years + 1)
|
||||
} else {
|
||||
if hide_prefix {
|
||||
format!("{} years", years + 1)
|
||||
} else {
|
||||
format!("almost {} years", years + 1)
|
||||
}
|
||||
.to_string()
|
||||
format!("almost {} years", years + 1)
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user