From 093d0bae401962a298daa86ea3d8c203d16745a5 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Wed, 27 Dec 2017 19:19:28 -0800 Subject: [PATCH] Param ctor is private --- src/httprequest.rs | 8 ++++---- src/param.rs | 8 +++----- src/test.rs | 4 ++-- 3 files changed, 9 insertions(+), 11 deletions(-) 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, }