From da0a806e8d254d3a2bea36721928805476c7d5d5 Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Sun, 25 Sep 2022 21:08:34 +0100 Subject: [PATCH] clippy --- actix-identity/tests/integration/test_app.rs | 2 +- actix-session/src/lib.rs | 2 +- actix-session/src/session.rs | 4 ++-- actix-session/src/session_ext.rs | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/actix-identity/tests/integration/test_app.rs b/actix-identity/tests/integration/test_app.rs index 2192c1954..9ff493e3f 100644 --- a/actix-identity/tests/integration/test_app.rs +++ b/actix-identity/tests/integration/test_app.rs @@ -135,7 +135,7 @@ async fn increment(session: Session, user: Option) -> HttpResponse { .get::("counter") .unwrap_or(Some(0)) .map_or(1, |inner| inner + 1); - session.insert("counter", &counter).unwrap(); + session.insert("counter", counter).unwrap(); HttpResponse::Ok().json(&EndpointResponse { user_id, diff --git a/actix-session/src/lib.rs b/actix-session/src/lib.rs index dd844bef0..24c76324b 100644 --- a/actix-session/src/lib.rs +++ b/actix-session/src/lib.rs @@ -674,7 +674,7 @@ pub mod test_helpers { .get::("counter") .unwrap_or(Some(0)) .map_or(1, |inner| inner + 1); - session.insert("counter", &counter)?; + session.insert("counter", counter)?; Ok(HttpResponse::Ok().json(&IndexResponse { user_id, counter })) } diff --git a/actix-session/src/session.rs b/actix-session/src/session.rs index 145fc189b..35aaaa3f2 100644 --- a/actix-session/src/session.rs +++ b/actix-session/src/session.rs @@ -222,7 +222,7 @@ impl Session { req: &mut ServiceRequest, data: impl IntoIterator, ) { - let session = Session::get_session(&mut *req.extensions_mut()); + let session = Session::get_session(&mut req.extensions_mut()); let mut inner = session.0.borrow_mut(); inner.state.extend(data); } @@ -285,7 +285,7 @@ impl FromRequest for Session { #[inline] fn from_request(req: &HttpRequest, _: &mut Payload) -> Self::Future { - ready(Ok(Session::get_session(&mut *req.extensions_mut()))) + ready(Ok(Session::get_session(&mut req.extensions_mut()))) } } diff --git a/actix-session/src/session_ext.rs b/actix-session/src/session_ext.rs index 1cff2b472..eefdc6f2b 100644 --- a/actix-session/src/session_ext.rs +++ b/actix-session/src/session_ext.rs @@ -15,13 +15,13 @@ pub trait SessionExt { impl SessionExt for HttpRequest { fn get_session(&self) -> Session { - Session::get_session(&mut *self.extensions_mut()) + Session::get_session(&mut self.extensions_mut()) } } impl SessionExt for ServiceRequest { fn get_session(&self) -> Session { - Session::get_session(&mut *self.extensions_mut()) + Session::get_session(&mut self.extensions_mut()) } } @@ -33,6 +33,6 @@ impl SessionExt for ServiceResponse { impl<'a> SessionExt for GuardContext<'a> { fn get_session(&self) -> Session { - Session::get_session(&mut *self.req_data_mut()) + Session::get_session(&mut self.req_data_mut()) } }