fix build breakage in benchmarks

This commit is contained in:
Benjamin Fry 2019-10-26 18:24:15 -07:00
parent 1663c90165
commit 53db2b2ce4
2 changed files with 22 additions and 26 deletions

39
Cargo.lock generated
View File

@ -1,17 +1,5 @@
[root]
name = "trust-dns-util"
version = "0.18.0-alpha.1"
dependencies = [
"clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)",
"data-encoding 2.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"env_logger 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl 0.10.25 (registry+https://github.com/rust-lang/crates.io-index)",
"trust-dns-client 0.18.0-alpha.1",
"trust-dns-proto 0.18.0-alpha.1",
"trust-dns-resolver 0.18.0-alpha.1",
]
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
[[package]]
name = "aho-corasick"
version = "0.7.6"
@ -410,11 +398,6 @@ dependencies = [
"wasi 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "getrandom_package"
version = "0.1.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "h2"
version = "0.2.0-alpha.3"
@ -866,7 +849,7 @@ name = "rand"
version = "0.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"getrandom_package 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)",
"getrandom 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)",
"rand_chacha 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1232,6 +1215,7 @@ dependencies = [
"num_cpus 1.10.1 (registry+https://github.com/rust-lang/crates.io-index)",
"slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-sync 0.2.0-alpha.6 (registry+https://github.com/rust-lang/crates.io-index)",
"tracing 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -1626,6 +1610,20 @@ dependencies = [
"trust-dns-rustls 0.18.0-alpha.1",
]
[[package]]
name = "trust-dns-util"
version = "0.18.0-alpha.1"
dependencies = [
"clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)",
"data-encoding 2.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"env_logger 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl 0.10.25 (registry+https://github.com/rust-lang/crates.io-index)",
"trust-dns-client 0.18.0-alpha.1",
"trust-dns-proto 0.18.0-alpha.1",
"trust-dns-resolver 0.18.0-alpha.1",
]
[[package]]
name = "typed-headers"
version = "0.1.1"
@ -1936,7 +1934,6 @@ dependencies = [
"checksum futures-sink-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)" = "86f148ef6b69f75bb610d4f9a2336d4fc88c4b5b67129d1a340dd0fd362efeec"
"checksum futures-util-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)" = "5ce968633c17e5f97936bd2797b6e38fb56cf16a7422319f7ec2e30d3c470e8d"
"checksum getrandom 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "e7db7ca94ed4cd01190ceee0d8a8052f08a247aa1b469a7f68c6a3b71afcf407"
"checksum getrandom_package 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)" = "45510b03235e6cc51fa1744340970d7b14c10bce9036d79031acf20ecb5f8c8f"
"checksum h2 0.2.0-alpha.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0f107db1419ef8271686187b1a5d47c6431af4a7f4d98b495e7b7fc249bb0a78"
"checksum heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205"
"checksum hostname 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "21ceb46a83a85e824ef93669c8b390009623863b5c195d1ba747292c0c72f94e"

View File

@ -4,7 +4,6 @@ extern crate futures;
extern crate test;
extern crate tokio;
extern crate tokio_net;
extern crate tokio_net;
extern crate trust_dns_client;
extern crate trust_dns_proto;
@ -117,9 +116,9 @@ fn trust_dns_process() -> (NamedProcess, u16) {
/// Runs the bench tesk using the specified client
fn bench<F, S, R>(b: &mut Bencher, stream: F)
where
F: Future<Output = Result<S, ProtoError>> + 'static + Send,
F: Future<Output = Result<S, ProtoError>> + 'static + Send + Unpin,
S: DnsRequestSender<DnsResponseFuture = R>,
R: Future<Output = Result<DnsResponse, ProtoError>> + 'static + Send,
R: Future<Output = Result<DnsResponse, ProtoError>> + 'static + Send + Unpin,
{
let mut io_loop = Runtime::new().unwrap();
let (bg, mut client) = ClientFuture::connect(stream);
@ -128,8 +127,8 @@ where
let name = domain::Name::from_str("www.example.com.").unwrap();
// validate the request
let client = client.query(name.clone(), DNSClass::IN, RecordType::A);
let response = io_loop.block_on(client).expect("Request failed");
let query = client.query(name.clone(), DNSClass::IN, RecordType::A);
let response = io_loop.block_on(query).expect("Request failed");
assert_eq!(response.response_code(), ResponseCode::NoError);