fix clippy and compile errors

This commit is contained in:
XOR-op
2023-01-20 02:51:15 +08:00
committed by Benjamin Fry
parent 22beac02ce
commit 03af149076
16 changed files with 153 additions and 138 deletions

View File

@@ -37,11 +37,11 @@ fn test_send_sync() {
fn test_lookup_google() {
use testing::lookup_test;
let io_loop = AsyncStdRuntimeProvider::new();
let handle = io_loop.clone();
lookup_test::<AsyncStdRuntimeProvider, AsyncStdRuntimeProvider>(
ResolverConfig::google(),
io_loop,
handle,
io_loop,
)
}
@@ -49,11 +49,10 @@ fn test_lookup_google() {
fn test_lookup_cloudflare() {
use testing::lookup_test;
let io_loop = AsyncStdRuntimeProvider::new();
let handle = io_loop.clone();
lookup_test::<AsyncStdRuntimeProvider, AsyncStdRuntimeProvider>(
ResolverConfig::cloudflare(),
io_loop,
handle,
io_loop,
)
}
@@ -61,11 +60,10 @@ fn test_lookup_cloudflare() {
fn test_lookup_quad9() {
use testing::lookup_test;
let io_loop = AsyncStdRuntimeProvider::new();
let handle = io_loop.clone();
lookup_test::<AsyncStdRuntimeProvider, AsyncStdRuntimeProvider>(
ResolverConfig::quad9(),
io_loop,
handle,
io_loop,
)
}
@@ -73,16 +71,14 @@ fn test_lookup_quad9() {
fn test_ip_lookup() {
use testing::ip_lookup_test;
let io_loop = AsyncStdRuntimeProvider::new();
let handle = io_loop.clone();
ip_lookup_test::<AsyncStdRuntimeProvider, AsyncStdRuntimeProvider>(io_loop, handle)
ip_lookup_test::<AsyncStdRuntimeProvider, AsyncStdRuntimeProvider>(io_loop, io_loop)
}
#[test]
fn test_ip_lookup_across_threads() {
use testing::ip_lookup_across_threads_test;
let io_loop = AsyncStdRuntimeProvider::new();
let handle = io_loop.clone();
ip_lookup_across_threads_test::<AsyncStdRuntimeProvider, AsyncStdRuntimeProvider>(handle)
ip_lookup_across_threads_test::<AsyncStdRuntimeProvider, AsyncStdRuntimeProvider>(io_loop)
}
#[test]
@@ -90,8 +86,7 @@ fn test_ip_lookup_across_threads() {
fn test_sec_lookup() {
use testing::sec_lookup_test;
let io_loop = AsyncStdRuntimeProvider::new();
let handle = io_loop.clone();
sec_lookup_test::<AsyncStdRuntimeProvider, AsyncStdRuntimeProvider>(io_loop, handle);
sec_lookup_test::<AsyncStdRuntimeProvider, AsyncStdRuntimeProvider>(io_loop, io_loop);
}
#[test]
@@ -99,8 +94,7 @@ fn test_sec_lookup() {
fn test_sec_lookup_fails() {
use testing::sec_lookup_fails_test;
let io_loop = AsyncStdRuntimeProvider::new();
let handle = io_loop.clone();
sec_lookup_fails_test::<AsyncStdRuntimeProvider, AsyncStdRuntimeProvider>(io_loop, handle);
sec_lookup_fails_test::<AsyncStdRuntimeProvider, AsyncStdRuntimeProvider>(io_loop, io_loop);
}
#[test]
@@ -110,8 +104,7 @@ fn test_sec_lookup_fails() {
fn test_system_lookup() {
use testing::system_lookup_test;
let io_loop = AsyncStdRuntimeProvider::new();
let handle = io_loop.clone();
system_lookup_test::<AsyncStdRuntimeProvider, AsyncStdRuntimeProvider>(io_loop, handle);
system_lookup_test::<AsyncStdRuntimeProvider, AsyncStdRuntimeProvider>(io_loop, io_loop);
}
#[test]
@@ -122,81 +115,74 @@ fn test_system_lookup() {
fn test_hosts_lookup() {
use testing::hosts_lookup_test;
let io_loop = AsyncStdRuntimeProvider::new();
let handle = io_loop.clone();
hosts_lookup_test::<AsyncStdRuntimeProvider, AsyncStdRuntimeProvider>(io_loop, handle);
hosts_lookup_test::<AsyncStdRuntimeProvider, AsyncStdRuntimeProvider>(io_loop, io_loop);
}
#[test]
fn test_fqdn() {
use testing::fqdn_test;
let io_loop = AsyncStdRuntimeProvider::new();
let handle = io_loop.clone();
fqdn_test::<AsyncStdRuntimeProvider, AsyncStdRuntimeProvider>(io_loop, handle);
fqdn_test::<AsyncStdRuntimeProvider, AsyncStdRuntimeProvider>(io_loop, io_loop);
}
#[test]
fn test_ndots() {
use testing::ndots_test;
let io_loop = AsyncStdRuntimeProvider::new();
let handle = io_loop.clone();
ndots_test::<AsyncStdRuntimeProvider, AsyncStdRuntimeProvider>(io_loop, handle);
ndots_test::<AsyncStdRuntimeProvider, AsyncStdRuntimeProvider>(io_loop, io_loop);
}
#[test]
fn test_large_ndots() {
use testing::large_ndots_test;
let io_loop = AsyncStdRuntimeProvider::new();
let handle = io_loop.clone();
large_ndots_test::<AsyncStdRuntimeProvider, AsyncStdRuntimeProvider>(io_loop, handle);
large_ndots_test::<AsyncStdRuntimeProvider, AsyncStdRuntimeProvider>(io_loop, io_loop);
}
#[test]
fn test_domain_search() {
use testing::domain_search_test;
let io_loop = AsyncStdRuntimeProvider::new();
let handle = io_loop.clone();
domain_search_test::<AsyncStdRuntimeProvider, AsyncStdRuntimeProvider>(io_loop, handle);
domain_search_test::<AsyncStdRuntimeProvider, AsyncStdRuntimeProvider>(io_loop, io_loop);
}
#[test]
fn test_search_list() {
use testing::search_list_test;
let io_loop = AsyncStdRuntimeProvider::new();
let handle = io_loop.clone();
search_list_test::<AsyncStdRuntimeProvider, AsyncStdRuntimeProvider>(io_loop, handle);
search_list_test::<AsyncStdRuntimeProvider, AsyncStdRuntimeProvider>(io_loop, io_loop);
}
#[test]
fn test_idna() {
use testing::idna_test;
let io_loop = AsyncStdRuntimeProvider::new();
let handle = io_loop.clone();
idna_test::<AsyncStdRuntimeProvider, AsyncStdRuntimeProvider>(io_loop, handle);
idna_test::<AsyncStdRuntimeProvider, AsyncStdRuntimeProvider>(io_loop, io_loop);
}
#[test]
fn test_localhost_ipv4() {
use testing::localhost_ipv4_test;
let io_loop = AsyncStdRuntimeProvider::new();
let handle = io_loop.clone();
localhost_ipv4_test::<AsyncStdRuntimeProvider, AsyncStdRuntimeProvider>(io_loop, handle);
localhost_ipv4_test::<AsyncStdRuntimeProvider, AsyncStdRuntimeProvider>(io_loop, io_loop);
}
#[test]
fn test_localhost_ipv6() {
use testing::localhost_ipv6_test;
let io_loop = AsyncStdRuntimeProvider::new();
let handle = io_loop.clone();
localhost_ipv6_test::<AsyncStdRuntimeProvider, AsyncStdRuntimeProvider>(io_loop, handle);
localhost_ipv6_test::<AsyncStdRuntimeProvider, AsyncStdRuntimeProvider>(io_loop, io_loop);
}
#[test]
fn test_search_ipv4_large_ndots() {
use testing::search_ipv4_large_ndots_test;
let io_loop = AsyncStdRuntimeProvider::new();
let handle = io_loop.clone();
search_ipv4_large_ndots_test::<AsyncStdRuntimeProvider, AsyncStdRuntimeProvider>(
io_loop, handle,
io_loop, io_loop,
);
}
@@ -204,9 +190,9 @@ fn test_search_ipv4_large_ndots() {
fn test_search_ipv6_large_ndots() {
use testing::search_ipv6_large_ndots_test;
let io_loop = AsyncStdRuntimeProvider::new();
let handle = io_loop.clone();
search_ipv6_large_ndots_test::<AsyncStdRuntimeProvider, AsyncStdRuntimeProvider>(
io_loop, handle,
io_loop, io_loop,
);
}
@@ -214,8 +200,8 @@ fn test_search_ipv6_large_ndots() {
fn test_search_ipv6_name_parse_fails() {
use testing::search_ipv6_name_parse_fails_test;
let io_loop = AsyncStdRuntimeProvider::new();
let handle = io_loop.clone();
search_ipv6_name_parse_fails_test::<AsyncStdRuntimeProvider, AsyncStdRuntimeProvider>(
io_loop, handle,
io_loop, io_loop,
);
}