Merge branch 'master' of github.com:lycheeverse/lychee

This commit is contained in:
Matthias 2021-10-28 03:30:50 +02:00
commit 37bbb14add
4 changed files with 29 additions and 12 deletions

22
Cargo.lock generated
View file

@ -663,6 +663,24 @@ dependencies = [
"tokio",
]
[[package]]
name = "deadpool"
version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "51dc1e92ba8164da131a4753a26cb1e7ebcfe617e56bb3c2b6136049c8ee5730"
dependencies = [
"async-trait",
"deadpool-runtime",
"num_cpus",
"tokio",
]
[[package]]
name = "deadpool-runtime"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eaa37046cc0f6c3cc6090fbdbf73ef0b8ef4cfcc37f6befc0020f63e8cf121e1"
[[package]]
name = "diff"
version = "0.1.12"
@ -1499,7 +1517,7 @@ version = "0.8.0"
dependencies = [
"cached",
"check-if-email-exists",
"deadpool",
"deadpool 0.9.1",
"doc-comment",
"fast_chemail",
"glob",
@ -3175,7 +3193,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "33807c11bd2c5a3896c36042ef2ca9663795bb7e4af2fe87474a159ea72c2159"
dependencies = [
"async-trait",
"deadpool",
"deadpool 0.7.0",
"futures",
"futures-timer",
"http-types",

View file

@ -18,7 +18,7 @@ version = "0.8.0"
[dependencies]
check-if-email-exists = "0.8.25"
deadpool = "0.7.0"
deadpool = "0.9.1"
fast_chemail = "0.9.6"
glob = "0.3.0"
html5ever = "0.25.1"

View file

@ -34,7 +34,7 @@ impl ClientPool {
/// asynchronously to a client from the pool
pub async fn listen(&mut self) {
while let Some(req) = self.rx.recv().await {
let client = self.pool.get().await;
let client = self.pool.get().await.unwrap();
let tx = self.tx.clone();
tokio::spawn(async move {
// Client::check() may fail only because Request::try_from() may fail

View file

@ -155,13 +155,12 @@ impl Filter {
if is_false_positive(input)
// Exclude well-known false-positives
// Performed after checking includes to allow user-overwriddes
// Performed after checking includes to allow user-overwrites
|| self.is_excludes_empty()
// Previous checks imply input is not explicitly included,
// if excludes rules is empty, then *presumably excluded*
// Previous checks imply input is not explicitly included.
// If exclude rules are empty, then *presumably excluded*
|| self.is_excludes_match(input)
// If excludes rules matches input, then
// *explicitly excluded*
// If exclude rules match input, then *explicitly excluded*
{
return true;
}
@ -179,8 +178,8 @@ mod test {
use super::{Excludes, Filter, Includes};
use crate::test_utils::{mail, website};
// Note: the standard library as of Rust stable 1.47.0 does not expose
// "link-local" or "private" IPv6 checks. However, one might argue
// Note: the standard library, as of Rust stable 1.47.0, does not expose
// "link-local" or "private" IPv6 checks. However, one might argue
// that these concepts do exist in IPv6, albeit the naming is different.
// See: https://en.wikipedia.org/wiki/Link-local_address#IPv6
// See: https://en.wikipedia.org/wiki/Private_network#IPv6
@ -236,7 +235,7 @@ mod test {
#[test]
fn test_includes_and_excludes_empty() {
// This is the pre-configured, empty set of excludes for a client
// This is the pre-configured, empty set of excludes for a client.
// In this case, only the requests matching the include set will be checked
let filter = Filter::default();