mirror of
https://github.com/fafhrd91/actix-web
synced 2024-11-30 18:44:35 +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> {
|
||||
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(),
|
||||
}
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user