declone and close the door (#12035)

* declone and close the door

* cargo fmt

* remove brackets
This commit is contained in:
Squirrel
2022-08-15 20:38:36 +01:00
committed by GitHub
parent 9c2a2495fe
commit a68a80fbae
72 changed files with 344 additions and 512 deletions
+1 -1
View File
@@ -170,7 +170,7 @@ fn test_calculate_for_fraction_times_denominator() {
};
pub fn formal_calculate_for_fraction_times_denominator(n: u64, d: u64) -> u64 {
if n <= Perbill::from_parts(0_500_000_000) * d.clone() {
if n <= Perbill::from_parts(0_500_000_000) * d {
n + d / 2
} else {
(d as u128 * 2 - n as u128 * 2).try_into().unwrap()