Skip to content

Commit 24305ba

Browse files
authored
UserAuthenticationExt: Remove obsolete mut keyword (#5537)
There is no need anymore for us to have a mutable reference to the `Request` struct.
1 parent 5bf3eb2 commit 24305ba

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/auth.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,12 @@ fn authenticate_user(req: &dyn RequestExt) -> AppResult<AuthenticatedUser> {
8787
}
8888

8989
pub trait UserAuthenticationExt {
90-
fn authenticate(&mut self) -> AppResult<AuthenticatedUser>;
90+
fn authenticate(&self) -> AppResult<AuthenticatedUser>;
9191
}
9292

9393
impl<'a> UserAuthenticationExt for dyn RequestExt + 'a {
9494
/// Obtain `AuthenticatedUser` for the request or return an `Forbidden` error
95-
fn authenticate(&mut self) -> AppResult<AuthenticatedUser> {
95+
fn authenticate(&self) -> AppResult<AuthenticatedUser> {
9696
controllers::util::verify_origin(self)?;
9797

9898
let authenticated_user = authenticate_user(self)?;

0 commit comments

Comments
 (0)