From 424ce126a56660168f8284fa34ae80cb93d74289 Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Thu, 26 Sep 2019 11:53:32 +0200 Subject: linting: Clear up bare trait object warnings Newer Rust compilers requre `dyn` marking trait objects. Signed-off-by: Daniel Silverstone --- net/src/lib.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'net') diff --git a/net/src/lib.rs b/net/src/lib.rs index 771b7d9f..6b1b10b9 100644 --- a/net/src/lib.rs +++ b/net/src/lib.rs @@ -83,7 +83,7 @@ const KEYSERVER_ENCODE_SET: &AsciiSet = /// For accessing keyservers using HKP. pub struct KeyServer { - client: Box, + client: Box, uri: Url, } @@ -95,7 +95,7 @@ impl KeyServer { let uri: Url = uri.parse() .or_else(|_| format!("hkps://{}", uri).parse())?; - let client: Box = match uri.scheme() { + let client: Box = match uri.scheme() { "hkp" => Box::new(Client::new()), "hkps" => { Box::new(Client::builder() @@ -114,7 +114,7 @@ impl KeyServer { -> Result { let uri: Url = uri.parse()?; - let client: Box = { + let client: Box = { let mut tls = TlsConnector::builder(); tls.add_root_certificate(cert); let tls = tls.build()?; @@ -137,7 +137,7 @@ impl KeyServer { } /// Common code for the above functions. - fn make(ctx: &Context, client: Box, uri: Url) -> Result { + fn make(ctx: &Context, client: Box, uri: Url) -> Result { let s = uri.scheme(); match s { "hkp" => ctx.network_policy().assert(NetworkPolicy::Insecure), @@ -160,7 +160,7 @@ impl KeyServer { /// Retrieves the key with the given `keyid`. pub fn get(&mut self, keyid: &KeyID) - -> Box + 'static> { + -> Box + 'static> { let uri = self.uri.join( &format!("pks/lookup?op=get&options=mr&search=0x{}", keyid.to_hex())); @@ -192,7 +192,7 @@ impl KeyServer { /// Sends the given key to the server. pub fn send(&mut self, key: &TPK) - -> Box + 'static> { + -> Box + 'static> { use crate::openpgp::armor::{Writer, Kind}; let uri = -- cgit v1.2.3