1
0
mirror of https://github.com/fafhrd91/actix-web synced 2024-11-27 17:52:56 +01:00

Merge branch 'master' of github.com:actix/actix-web

This commit is contained in:
Nikolay Kim 2019-07-30 08:00:57 -07:00
commit e9b4aa205f
5 changed files with 10 additions and 6 deletions

View File

@ -2,6 +2,10 @@
## [0.2.8] - 2019-07-xx ## [0.2.8] - 2019-07-xx
### Changed
* Add `Clone` impl for `HeaderMap`
### Fixed ### Fixed
* awc client panic #1016 * awc client panic #1016

View File

@ -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. /// Downcasts a response error to a specific type.
pub fn downcast_ref<T: ResponseError + 'static>(&self) -> Option<&T> { pub fn downcast_ref<T: ResponseError + 'static>(&self) -> Option<&T> {
if self.__private_get_type_id__() == TypeId::of::<T>() { if self.__private_get_type_id__() == TypeId::of::<T>() {
unsafe { Some(&*(self as *const ResponseError as *const T)) } unsafe { Some(&*(self as *const dyn ResponseError as *const T)) }
} else { } else {
None None
} }

View File

@ -9,12 +9,12 @@ use http::HttpTryFrom;
/// `HeaderMap` is an multimap of [`HeaderName`] to values. /// `HeaderMap` is an multimap of [`HeaderName`] to values.
/// ///
/// [`HeaderName`]: struct.HeaderName.html /// [`HeaderName`]: struct.HeaderName.html
#[derive(Debug)] #[derive(Debug, Clone)]
pub struct HeaderMap { pub struct HeaderMap {
pub(crate) inner: HashMap<HeaderName, Value>, pub(crate) inner: HashMap<HeaderName, Value>,
} }
#[derive(Debug)] #[derive(Debug, Clone)]
pub(crate) enum Value { pub(crate) enum Value {
One(HeaderValue), One(HeaderValue),
Multi(Vec<HeaderValue>), Multi(Vec<HeaderValue>),

View File

@ -133,7 +133,7 @@ impl AppConfig {
/// Set server host name. /// 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. /// generation. Check [ConnectionInfo](./dev/struct.ConnectionInfo.
/// html#method.host) documentation for more information. /// html#method.host) documentation for more information.
/// ///

View File

@ -180,7 +180,7 @@ where
/// Set server host name. /// 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. /// generation. Check [ConnectionInfo](./dev/struct.ConnectionInfo.
/// html#method.host) documentation for more information. /// html#method.host) documentation for more information.
pub fn server_hostname<T: AsRef<str>>(mut self, val: T) -> Self { pub fn server_hostname<T: AsRef<str>>(mut self, val: T) -> Self {