1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-12-21 07:36:43 +00:00

remove public Clone for Request

This commit is contained in:
Nikolay Kim 2018-07-04 22:57:40 +06:00
parent 5d79114239
commit d5606625a2
2 changed files with 9 additions and 4 deletions

View file

@ -74,7 +74,7 @@ impl<S> HttpRequest<S> {
pub(crate) fn with_state<NS>(&self, state: Rc<NS>) -> HttpRequest<NS> {
HttpRequest {
state,
req: self.req.clone(),
req: self.req.as_ref().map(|r| r.clone()),
route: self.route.clone(),
}
}
@ -84,7 +84,7 @@ impl<S> HttpRequest<S> {
pub(crate) fn with_route_info(&self, route: RouteInfo) -> HttpRequest<S> {
HttpRequest {
route,
req: self.req.clone(),
req: self.req.as_ref().map(|r| r.clone()),
state: self.state.clone(),
}
}
@ -327,7 +327,7 @@ impl<S> Drop for HttpRequest<S> {
impl<S> Clone for HttpRequest<S> {
fn clone(&self) -> HttpRequest<S> {
HttpRequest {
req: self.req.clone(),
req: self.req.as_ref().map(|r| r.clone()),
state: self.state.clone(),
route: self.route.clone(),
}

View file

@ -20,7 +20,6 @@ bitflags! {
}
/// Request's context
#[derive(Clone)]
pub struct Request {
pub(crate) inner: Rc<InnerRequest>,
}
@ -196,6 +195,12 @@ impl Request {
&self.inner().settings
}
pub(crate) fn clone(&self) -> Self {
Request {
inner: self.inner.clone(),
}
}
pub(crate) fn release(self) {
let mut inner = self.inner;
if let Some(r) = Rc::get_mut(&mut inner) {