Skip to content
This repository was archived by the owner on Jan 5, 2023. It is now read-only.

Commit 9251678

Browse files
committed
Update dependencies and use new LruCache 0.8 API
1 parent 8e26c28 commit 9251678

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ flate2 = { version = "1.0", optional = true }
2626
lazy_static = { version = "1.4", optional = true }
2727
url = { version = "2", optional = true }
2828
regex = { version = "1", optional = true }
29-
lru = { version = "0.7", optional = true }
29+
lru = { version = "0.8", optional = true }
3030
bloomfilter = { version = "1.0", optional = true }
3131
ring = { version = "0.16", optional = true }
3232
cfg-if = "1.0"

src/rewriter.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use lru::LruCache;
22
use regex::Regex;
33
use std::error::Error;
4+
use std::num::NonZeroUsize;
45
use std::sync::{Arc, atomic::{AtomicUsize, Ordering}, Mutex};
56
use std::collections::VecDeque;
67

@@ -47,7 +48,7 @@ impl Rewriter {
4748
blooms: Arc::new(Mutex::new(vec![])),
4849
settings,
4950
rewrite_count: AtomicUsize::new(0),
50-
cookie_host_safety_cache: LruCache::new(250), // 250 is somewhat arbitrary
51+
cookie_host_safety_cache: LruCache::new(NonZeroUsize::new(250).unwrap()), // 250 is somewhat arbitrary
5152
rewrite_history: VecDeque::with_capacity(15),
5253
}
5354
}
@@ -275,7 +276,7 @@ impl NewRewriterWithBloom for Rewriter {
275276
blooms,
276277
settings,
277278
rewrite_count: AtomicUsize::new(0),
278-
cookie_host_safety_cache: LruCache::new(250), // 250 is somewhat arbitrary
279+
cookie_host_safety_cache: LruCache::new(NonZeroUsize::new(250).unwrap()), // 250 is somewhat arbitrary
279280
rewrite_history: VecDeque::with_capacity(15),
280281
}
281282
}

0 commit comments

Comments
 (0)