Skip to content

Commit

Permalink
fix linter code and confirm all tests still pass
Browse files Browse the repository at this point in the history
  • Loading branch information
GlenDC committed Apr 9, 2024
1 parent 1daf82c commit c425b96
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions benches/proxies/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ impl ProxyDB for InMemProxyDB {
}

fn get(&self, id: u64) -> Option<Cow<Proxy>> {
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<Cow<Proxy>> {
Expand Down Expand Up @@ -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]))
}
}

Expand All @@ -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]))
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions benches/proxydb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down

0 comments on commit c425b96

Please sign in to comment.