diff --git a/lib/src/request/request.rs b/lib/src/request/request.rs index 6fc01d5e..a303141b 100644 --- a/lib/src/request/request.rs +++ b/lib/src/request/request.rs @@ -20,7 +20,7 @@ use http::hyper; #[derive(Clone)] struct RequestState<'r> { config: &'r Config, - state: &'r Container, + managed: &'r Container, params: RefCell>, route: Cell>, cookies: RefCell, @@ -59,7 +59,7 @@ impl<'r> Request<'r> { remote: None, state: RequestState { config: &rocket.config, - state: &rocket.state, + managed: &rocket.state, route: Cell::new(None), params: RefCell::new(Vec::new()), cookies: RefCell::new(CookieJar::new()), @@ -559,7 +559,7 @@ impl<'r> Request<'r> { /// Get the managed state T, if it exists. For internal use only! #[inline(always)] pub(crate) fn get_state(&self) -> Option<&'r T> { - self.state.state.try_get() + self.state.managed.try_get() } /// Convert from Hyper types into a Rocket Request.