1
0
mirror of https://github.com/actix/actix-extras.git synced 2024-11-24 07:53:00 +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(),
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,

View File

@ -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();

View File

@ -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<S> TestRequest<S> {
uri: Uri::from_str("/").unwrap(),
version: Version::HTTP_11,
headers: HeaderMap::new(),
params: Params::default(),
params: Params::new(),
cookies: None,
payload: None,
}