Skip to content

Commit a6f58b7

Browse files
committed
fix: warning about manual implementation of '.is_multiple_of()'
1 parent 332ef29 commit a6f58b7

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

internal/cardano-node/mithril-cardano-node-internal-database/src/digesters/immutable_digester.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ pub(super) struct Progress {
177177
impl Progress {
178178
pub(super) fn report(&mut self, ix: usize) -> bool {
179179
self.index = ix;
180-
(20 * ix) % self.total == 0
180+
(20 * ix).is_multiple_of(self.total)
181181
}
182182

183183
pub(super) fn percent(&self) -> f64 {

internal/cardano-node/mithril-cardano-node-internal-database/src/test/dummy_cardano_db.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ impl DummyCardanoDbBuilder {
211211
/// Note: by default, the size of the produced files is less than 1 kb.
212212
pub fn set_immutable_trio_file_size(&mut self, trio_file_size: u64) -> &mut Self {
213213
assert!(
214-
trio_file_size % 3 == 0,
214+
trio_file_size.is_multiple_of(3),
215215
"'trio_file_size' must be a multiple of 3"
216216
);
217217

mithril-aggregator/src/services/epoch_service.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1019,7 +1019,7 @@ mod tests {
10191019

10201020
let stake_store = {
10211021
assert!(
1022-
self.total_stake % self.total_spo as u64 == 0,
1022+
self.total_stake.is_multiple_of(self.total_spo as u64),
10231023
"'total_stake' must be a multiple of 'total_spo' to create a uniform stake distribution"
10241024
);
10251025
let stake_per_spo = self.total_stake / self.total_spo as u64;

0 commit comments

Comments
 (0)