From a8e1e9ac35750453c62121347cf740435e238422 Mon Sep 17 00:00:00 2001 From: Joseph Birr-Pixton Date: Sun, 15 Jul 2018 15:02:42 +0100 Subject: [PATCH] Fix warnings now set_single_cert yields a Result --- examples/server/src/main.rs | 3 ++- tests/test.rs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/server/src/main.rs b/examples/server/src/main.rs index 7e59cd1..8d1718a 100644 --- a/examples/server/src/main.rs +++ b/examples/server/src/main.rs @@ -45,7 +45,8 @@ fn main() { let flag_echo = matches.occurrences_of("echo") > 0; let mut config = ServerConfig::new(NoClientAuth::new()); - config.set_single_cert(load_certs(cert_file), load_keys(key_file).remove(0)); + config.set_single_cert(load_certs(cert_file), load_keys(key_file).remove(0)) + .expect("invalid key or certificate"); let arc_config = Arc::new(config); let socket = TcpListener::bind(&addr).unwrap(); diff --git a/tests/test.rs b/tests/test.rs index 246e85a..e64dd82 100644 --- a/tests/test.rs +++ b/tests/test.rs @@ -26,7 +26,8 @@ fn start_server(cert: Vec, rsa: PrivateKey) -> SocketAddr { use tokio::io as aio; let mut config = ServerConfig::new(rustls::NoClientAuth::new()); - config.set_single_cert(cert, rsa); + config.set_single_cert(cert, rsa) + .expect("invalid key or certificate"); let config = Arc::new(config); let (send, recv) = channel();