1
0
mirror of https://github.com/fafhrd91/actix-web synced 2024-11-24 08:22:59 +01:00

Param ctor is private

This commit is contained in:
Nikolay Kim 2017-12-27 19:19:28 -08:00
parent 8941557da6
commit 093d0bae40
3 changed files with 9 additions and 11 deletions

View File

@ -44,8 +44,8 @@ impl Default for HttpMessage {
uri: Uri::default(), uri: Uri::default(),
version: Version::HTTP_11, version: Version::HTTP_11,
headers: HeaderMap::with_capacity(16), headers: HeaderMap::with_capacity(16),
params: Params::default(), params: Params::new(),
query: Params::default(), query: Params::new(),
query_loaded: false, query_loaded: false,
cookies: None, cookies: None,
addr: None, addr: None,
@ -106,8 +106,8 @@ impl HttpRequest<()> {
uri: uri, uri: uri,
version: version, version: version,
headers: headers, headers: headers,
params: Params::default(), params: Params::new(),
query: Params::default(), query: Params::new(),
query_loaded: false, query_loaded: false,
cookies: None, cookies: None,
addr: None, addr: None,

View File

@ -24,13 +24,11 @@ pub trait FromParam: Sized {
#[derive(Debug)] #[derive(Debug)]
pub struct Params<'a>(SmallVec<[(Cow<'a, str>, Cow<'a, str>); 3]>); pub struct Params<'a>(SmallVec<[(Cow<'a, str>, Cow<'a, str>); 3]>);
impl<'a> Default for Params<'a> { impl<'a> Params<'a> {
fn default() -> Params<'a> {
pub(crate) fn new() -> Params<'a> {
Params(SmallVec::new()) Params(SmallVec::new())
} }
}
impl<'a> Params<'a> {
pub(crate) fn clear(&mut self) { pub(crate) fn clear(&mut self) {
self.0.clear(); self.0.clear();

View File

@ -264,7 +264,7 @@ impl Default for TestRequest<()> {
uri: Uri::from_str("/").unwrap(), uri: Uri::from_str("/").unwrap(),
version: Version::HTTP_11, version: Version::HTTP_11,
headers: HeaderMap::new(), headers: HeaderMap::new(),
params: Params::default(), params: Params::new(),
cookies: None, cookies: None,
payload: None, payload: None,
} }
@ -297,7 +297,7 @@ impl<S> TestRequest<S> {
uri: Uri::from_str("/").unwrap(), uri: Uri::from_str("/").unwrap(),
version: Version::HTTP_11, version: Version::HTTP_11,
headers: HeaderMap::new(), headers: HeaderMap::new(),
params: Params::default(), params: Params::new(),
cookies: None, cookies: None,
payload: None, payload: None,
} }