Skip to content

Commit 0b155fd

Browse files
committed
chore(deps): update lru
1 parent e64faa8 commit 0b155fd

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

tox_core/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ nom = "7.1"
2828
cookie-factory = "0.3"
2929
get_if_addrs = "0.5"
3030
thiserror = "1.0"
31-
lru = "0.7"
31+
lru = "0.8"
3232
bitflags = "1.3"
3333
itertools = "0.10"
3434
rand = "0.8"

tox_core/src/dht/precomputed_cache.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//! LRU cache for `SalsaBox`es.
22
33
use std::sync::Arc;
4+
use std::num::NonZeroUsize;
45

56
use crypto_box::SalsaBox;
67
use lru::LruCache;
@@ -22,6 +23,7 @@ pub struct PrecomputedCache {
2223
impl PrecomputedCache {
2324
/// Create new `PrecomputedCache`.
2425
pub fn new(sk: SecretKey, capacity: usize) -> PrecomputedCache {
26+
let capacity = NonZeroUsize::new(capacity).expect("must be non zero");
2527
PrecomputedCache {
2628
sk,
2729
precomputed_keys: Arc::new(Mutex::new(LruCache::new(capacity))),

0 commit comments

Comments
 (0)