From 2052a374624c22e40e43c4a40f9867f4572aa0f6 Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Fri, 1 May 2020 23:48:02 +0100 Subject: [PATCH] remove deprecated try macros --- actix-http/src/extensions.rs | 2 ++ actix-http/src/header/common/range.rs | 6 +++--- src/config.rs | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/actix-http/src/extensions.rs b/actix-http/src/extensions.rs index 6a4a034a4..4e3918537 100644 --- a/actix-http/src/extensions.rs +++ b/actix-http/src/extensions.rs @@ -6,6 +6,8 @@ use fxhash::FxHashMap; #[derive(Default)] /// A type map of request extensions. pub struct Extensions { + /// Use FxHasher with a std HashMap with for faster + /// lookups on the small `TypeId` (u64 equivalent) keys. map: FxHashMap>, } diff --git a/actix-http/src/header/common/range.rs b/actix-http/src/header/common/range.rs index 77b7145a7..f9e203bb2 100644 --- a/actix-http/src/header/common/range.rs +++ b/actix-http/src/header/common/range.rs @@ -183,13 +183,13 @@ impl fmt::Display for Range { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match *self { Range::Bytes(ref ranges) => { - try!(write!(f, "bytes=")); + write!(f, "bytes=")?; for (i, range) in ranges.iter().enumerate() { if i != 0 { - try!(f.write_str(",")); + f.write_str(",")?; } - try!(Display::fmt(range, f)); + Display::fmt(range, f)?; } Ok(()) } diff --git a/src/config.rs b/src/config.rs index 6db378c7b..19a5ccc7b 100644 --- a/src/config.rs +++ b/src/config.rs @@ -123,6 +123,7 @@ impl AppService { } } +/// Application connection config #[derive(Clone)] pub struct AppConfig(Rc);