diff --git a/src/httprequest.rs b/src/httprequest.rs index 4b8f18b07..6d763e2f3 100644 --- a/src/httprequest.rs +++ b/src/httprequest.rs @@ -44,8 +44,8 @@ impl Default for HttpMessage { uri: Uri::default(), version: Version::HTTP_11, headers: HeaderMap::with_capacity(16), - params: Params::default(), - query: Params::default(), + params: Params::new(), + query: Params::new(), query_loaded: false, cookies: None, addr: None, @@ -106,8 +106,8 @@ impl HttpRequest<()> { uri: uri, version: version, headers: headers, - params: Params::default(), - query: Params::default(), + params: Params::new(), + query: Params::new(), query_loaded: false, cookies: None, addr: None, diff --git a/src/param.rs b/src/param.rs index b2e7c6029..530e62089 100644 --- a/src/param.rs +++ b/src/param.rs @@ -24,13 +24,11 @@ pub trait FromParam: Sized { #[derive(Debug)] pub struct Params<'a>(SmallVec<[(Cow<'a, str>, Cow<'a, str>); 3]>); -impl<'a> Default for Params<'a> { - fn default() -> Params<'a> { +impl<'a> Params<'a> { + + pub(crate) fn new() -> Params<'a> { Params(SmallVec::new()) } -} - -impl<'a> Params<'a> { pub(crate) fn clear(&mut self) { self.0.clear(); diff --git a/src/test.rs b/src/test.rs index 1ff954e76..11c03f35e 100644 --- a/src/test.rs +++ b/src/test.rs @@ -264,7 +264,7 @@ impl Default for TestRequest<()> { uri: Uri::from_str("/").unwrap(), version: Version::HTTP_11, headers: HeaderMap::new(), - params: Params::default(), + params: Params::new(), cookies: None, payload: None, } @@ -297,7 +297,7 @@ impl TestRequest { uri: Uri::from_str("/").unwrap(), version: Version::HTTP_11, headers: HeaderMap::new(), - params: Params::default(), + params: Params::new(), cookies: None, payload: None, }