mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 14:37:57 +00:00
Clippy arithmetic new (#8282)
* optimize code * fix clippy replace = with += or %= * fix redundant closure found warning * redundant field names in struct initialization * fix clippy warning and optimize code * fix clippy warning * fix clippy warning * fix test error
This commit is contained in:
@@ -203,7 +203,7 @@ pub fn normalize<T>(input: &[T], targeted_sum: T) -> Result<Vec<T>, &'static str
|
||||
.expect("Proof provided in the module doc; qed.");
|
||||
if output_with_idx[min_index].1 >= threshold {
|
||||
min_index += 1;
|
||||
min_index = min_index % count;
|
||||
min_index %= count;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -215,7 +215,7 @@ pub fn normalize<T>(input: &[T], targeted_sum: T) -> Result<Vec<T>, &'static str
|
||||
.expect("Proof provided in the module doc; qed.");
|
||||
if output_with_idx[min_index].1 >= threshold {
|
||||
min_index += 1;
|
||||
min_index = min_index % count;
|
||||
min_index %= count;
|
||||
}
|
||||
leftover -= One::one()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user