random clippy

This commit is contained in:
Jędrzej Stuczyński
2026-03-03 16:39:51 +00:00
parent bd3678dd4f
commit 4e850f6fe0
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -127,7 +127,7 @@ impl DailyMerkleTree {
pub(crate) fn maybe_rebuild(&mut self) {
// every 1000 leaves, rebuild the tree to purge the history
// (I wish the API of the library allowed to do it without having to go through those extra steps...)
if !self.inserted_leaves.is_empty() && self.inserted_leaves.len() % 1000 == 0 {
if !self.inserted_leaves.is_empty() && self.inserted_leaves.len().is_multiple_of(1000) {
self.rebuild_without_history();
}
}
+1 -1
View File
@@ -803,7 +803,7 @@ impl EcashState {
merkle_entry.maybe_rebuild();
// toss a coin to check if we should clean memory of old merkle trees
if thread_rng().next_u32() % 10000 == 0 {
if thread_rng().next_u32().is_multiple_of(10000) {
let mut values_to_clean = Vec::new();
let cutoff = self.config.ticketbook_retention_cutoff();
info!("attempting to remove old issued ticketbooks. the cutoff is set to {cutoff}");