diff --git a/src/httprequest.rs b/src/httprequest.rs index 4b8f18b0..6d763e2f 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 b2e7c602..530e6208 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 1ff954e7..11c03f35 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, }