diff --git a/README.md b/README.md index 575dd6c..8639ad2 100644 --- a/README.md +++ b/README.md @@ -98,7 +98,7 @@ to learn how to use the `VennDB` and its generated code. Benchmarks displayed here are taken on a dev machine with following specs: -``` +```text Macbook Pro — 16 inch (2023) Chip: Apple M2 Pro Memory: 16 GB diff --git a/benches/proxies/mod.rs b/benches/proxies/mod.rs index a9ab705..39892d5 100644 --- a/benches/proxies/mod.rs +++ b/benches/proxies/mod.rs @@ -80,7 +80,7 @@ impl ProxyDB for InMemProxyDB { } fn get(&self, id: u64) -> Option> { - self.get_by_id(&id).map(|proxy| Cow::Borrowed(proxy)) + self.get_by_id(&id).map(Cow::Borrowed) } fn any_tcp(&self, pool: &str, country: &str) -> Option> { @@ -137,7 +137,7 @@ impl ProxyDB for NaiveProxyDB { } else { use rand::Rng; let index = rand::thread_rng().gen_range(0..found_proxies.len()); - Some(Cow::Borrowed(&found_proxies[index])) + Some(Cow::Borrowed(found_proxies[index])) } } @@ -158,7 +158,7 @@ impl ProxyDB for NaiveProxyDB { } else { use rand::Rng; let index = rand::thread_rng().gen_range(0..found_proxies.len()); - Some(Cow::Borrowed(&found_proxies[index])) + Some(Cow::Borrowed(found_proxies[index])) } } } diff --git a/benches/proxydb.rs b/benches/proxydb.rs index 74432b7..92aae8e 100644 --- a/benches/proxydb.rs +++ b/benches/proxydb.rs @@ -19,9 +19,11 @@ const COUNTRIES: [&str; 13] = [ "US", "CA", "GB", "DE", "FR", "IT", "ES", "AU", "JP", "CN", "FR", "IT", "ES", ]; +#[allow(clippy::declare_interior_mutable_const)] const COUNTER: AtomicUsize = AtomicUsize::new(0); fn next_round() -> usize { + #[allow(clippy::borrow_interior_mutable_const)] COUNTER.fetch_add(1, std::sync::atomic::Ordering::Relaxed) }