Skip to content

Commit

Permalink
fix(watcher): use unwrap_or_else
Browse files Browse the repository at this point in the history
  • Loading branch information
etienne-napoleone committed Nov 30, 2021
1 parent a126636 commit 1f6c37a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/watcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ impl Watcher {
new_txs: vec![],
cached_txs: HashMap::new(),
cache: Cache::new(30),
interval: time::interval(interval_duration.unwrap_or(time::Duration::from_millis(100))),
interval: time::interval(
interval_duration.unwrap_or_else(|| time::Duration::from_millis(100)),
),
}
}

Expand Down

0 comments on commit 1f6c37a

Please sign in to comment.