From 1f6c37aae611ba17591dc262057cc7fdd4546f2a Mon Sep 17 00:00:00 2001 From: etienne-napoleone Date: Tue, 30 Nov 2021 15:31:21 +0900 Subject: [PATCH] fix(watcher): use unwrap_or_else --- src/watcher.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/watcher.rs b/src/watcher.rs index 9577a41..9a0c62d 100644 --- a/src/watcher.rs +++ b/src/watcher.rs @@ -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)), + ), } }