From 6f2049ba9bc7303d6760366ca24417e1632e655b Mon Sep 17 00:00:00 2001 From: Cyril Plisko Date: Thu, 25 Jul 2019 13:06:23 +0300 Subject: [PATCH 1/3] Fix typo --- src/config.rs | 2 +- src/server.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/config.rs b/src/config.rs index bbbb3bb0..63fd31d2 100644 --- a/src/config.rs +++ b/src/config.rs @@ -133,7 +133,7 @@ impl AppConfig { /// Set server host name. /// - /// Host name is used by application router aa a hostname for url + /// Host name is used by application router as a hostname for url /// generation. Check [ConnectionInfo](./dev/struct.ConnectionInfo. /// html#method.host) documentation for more information. /// diff --git a/src/server.rs b/src/server.rs index aa654e57..d1a019a1 100644 --- a/src/server.rs +++ b/src/server.rs @@ -180,7 +180,7 @@ where /// Set server host name. /// - /// Host name is used by application router aa a hostname for url + /// Host name is used by application router as a hostname for url /// generation. Check [ConnectionInfo](./dev/struct.ConnectionInfo. /// html#method.host) documentation for more information. pub fn server_hostname>(mut self, val: T) -> Self { From 81ab37f23591e2404443d5cc260dca55abfa7cd5 Mon Sep 17 00:00:00 2001 From: Sven-Hendrik Haase Date: Mon, 29 Jul 2019 06:10:33 +0200 Subject: [PATCH 2/3] Fix two dyn warnings (#1015) --- actix-http/src/error.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/actix-http/src/error.rs b/actix-http/src/error.rs index cbb009a7..dcbc3cc9 100644 --- a/actix-http/src/error.rs +++ b/actix-http/src/error.rs @@ -89,11 +89,11 @@ pub trait ResponseError: fmt::Debug + fmt::Display { } } -impl ResponseError + 'static { +impl dyn ResponseError + 'static { /// Downcasts a response error to a specific type. pub fn downcast_ref(&self) -> Option<&T> { if self.__private_get_type_id__() == TypeId::of::() { - unsafe { Some(&*(self as *const ResponseError as *const T)) } + unsafe { Some(&*(self as *const dyn ResponseError as *const T)) } } else { None } From 511026cab01136d6e94f8fb234b66889b5cf27ef Mon Sep 17 00:00:00 2001 From: Sven-Hendrik Haase Date: Mon, 29 Jul 2019 06:11:23 +0200 Subject: [PATCH 3/3] Allow HeaderMap to be cloned (#1014) * Allow HeaderMap to be cloned * Add entry to changelog --- actix-http/CHANGES.md | 4 ++++ actix-http/src/header/map.rs | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/actix-http/CHANGES.md b/actix-http/CHANGES.md index 4b53161a..cffdd7af 100644 --- a/actix-http/CHANGES.md +++ b/actix-http/CHANGES.md @@ -2,6 +2,10 @@ ## [0.2.8] - 2019-07-xx +### Changed + +* Add `Clone` impl for `HeaderMap` + ### Fixed * Invalid response with compression middleware enabled, but compression-related features disabled #997 diff --git a/actix-http/src/header/map.rs b/actix-http/src/header/map.rs index 694aed02..f2f1ba51 100644 --- a/actix-http/src/header/map.rs +++ b/actix-http/src/header/map.rs @@ -9,12 +9,12 @@ use http::HttpTryFrom; /// `HeaderMap` is an multimap of [`HeaderName`] to values. /// /// [`HeaderName`]: struct.HeaderName.html -#[derive(Debug)] +#[derive(Debug, Clone)] pub struct HeaderMap { pub(crate) inner: HashMap, } -#[derive(Debug)] +#[derive(Debug, Clone)] pub(crate) enum Value { One(HeaderValue), Multi(Vec),