diff options
author | Daniel Silverstone <dsilvers@digital-scurf.org> | 2019-09-26 11:53:32 +0200 |
---|---|---|
committer | Neal H. Walfield <neal@pep.foundation> | 2019-09-27 22:12:11 +0200 |
commit | 424ce126a56660168f8284fa34ae80cb93d74289 (patch) | |
tree | 2c0440c1f3b0d557def5e1a496ee4ede22045a9b /net | |
parent | a69ec9f9c5097bb8acd1a4fe2144328c9dc4ade7 (diff) |
linting: Clear up bare trait object warnings
Newer Rust compilers requre `dyn` marking trait objects.
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
Diffstat (limited to 'net')
-rw-r--r-- | net/src/lib.rs | 12 |
1 files changed, 6 insertions, 6 deletions
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<AClient>, + client: Box<dyn AClient>, uri: Url, } @@ -95,7 +95,7 @@ impl KeyServer { let uri: Url = uri.parse() .or_else(|_| format!("hkps://{}", uri).parse())?; - let client: Box<AClient> = match uri.scheme() { + let client: Box<dyn AClient> = match uri.scheme() { "hkp" => Box::new(Client::new()), "hkps" => { Box::new(Client::builder() @@ -114,7 +114,7 @@ impl KeyServer { -> Result<Self> { let uri: Url = uri.parse()?; - let client: Box<AClient> = { + let client: Box<dyn AClient> = { 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<AClient>, uri: Url) -> Result<Self> { + fn make(ctx: &Context, client: Box<dyn AClient>, uri: Url) -> Result<Self> { 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<Future<Item=TPK, Error=failure::Error> + 'static> { + -> Box<dyn Future<Item=TPK, Error=failure::Error> + '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<Future<Item=(), Error=failure::Error> + 'static> { + -> Box<dyn Future<Item=(), Error=failure::Error> + 'static> { use crate::openpgp::armor::{Writer, Kind}; let uri = |