mirror of
https://github.com/fafhrd91/actix-web
synced 2024-11-27 17:52:56 +01:00
remove public Clone for Request
This commit is contained in:
parent
5d79114239
commit
d5606625a2
@ -74,7 +74,7 @@ impl<S> HttpRequest<S> {
|
|||||||
pub(crate) fn with_state<NS>(&self, state: Rc<NS>) -> HttpRequest<NS> {
|
pub(crate) fn with_state<NS>(&self, state: Rc<NS>) -> HttpRequest<NS> {
|
||||||
HttpRequest {
|
HttpRequest {
|
||||||
state,
|
state,
|
||||||
req: self.req.clone(),
|
req: self.req.as_ref().map(|r| r.clone()),
|
||||||
route: self.route.clone(),
|
route: self.route.clone(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -84,7 +84,7 @@ impl<S> HttpRequest<S> {
|
|||||||
pub(crate) fn with_route_info(&self, route: RouteInfo) -> HttpRequest<S> {
|
pub(crate) fn with_route_info(&self, route: RouteInfo) -> HttpRequest<S> {
|
||||||
HttpRequest {
|
HttpRequest {
|
||||||
route,
|
route,
|
||||||
req: self.req.clone(),
|
req: self.req.as_ref().map(|r| r.clone()),
|
||||||
state: self.state.clone(),
|
state: self.state.clone(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -327,7 +327,7 @@ impl<S> Drop for HttpRequest<S> {
|
|||||||
impl<S> Clone for HttpRequest<S> {
|
impl<S> Clone for HttpRequest<S> {
|
||||||
fn clone(&self) -> HttpRequest<S> {
|
fn clone(&self) -> HttpRequest<S> {
|
||||||
HttpRequest {
|
HttpRequest {
|
||||||
req: self.req.clone(),
|
req: self.req.as_ref().map(|r| r.clone()),
|
||||||
state: self.state.clone(),
|
state: self.state.clone(),
|
||||||
route: self.route.clone(),
|
route: self.route.clone(),
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,6 @@ bitflags! {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Request's context
|
/// Request's context
|
||||||
#[derive(Clone)]
|
|
||||||
pub struct Request {
|
pub struct Request {
|
||||||
pub(crate) inner: Rc<InnerRequest>,
|
pub(crate) inner: Rc<InnerRequest>,
|
||||||
}
|
}
|
||||||
@ -196,6 +195,12 @@ impl Request {
|
|||||||
&self.inner().settings
|
&self.inner().settings
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub(crate) fn clone(&self) -> Self {
|
||||||
|
Request {
|
||||||
|
inner: self.inner.clone(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub(crate) fn release(self) {
|
pub(crate) fn release(self) {
|
||||||
let mut inner = self.inner;
|
let mut inner = self.inner;
|
||||||
if let Some(r) = Rc::get_mut(&mut inner) {
|
if let Some(r) = Rc::get_mut(&mut inner) {
|
||||||
|
Loading…
Reference in New Issue
Block a user