Skip to content

Commit

Permalink
clean: run cargo clippy --fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Lzyct committed Jul 22, 2024
1 parent 487d10b commit 0128be0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/core/middlewares/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,15 @@ impl FromRequest for AuthMiddleware {
}
})?;

Ok(AuthMiddleware {
Ok(AuthMiddleware {
user,
login_session: token_data.claims.login_session,
})
})
}
}

pub fn decode_token(jwt: &String) -> AppResult<TokenData<AuthToken>> {
pub fn decode_token(jwt: &str) -> AppResult<TokenData<AuthToken>> {
let bytes_public_key = general_purpose::STANDARD
.decode(dotenv!("ACCESS_TOKEN_PUBLIC_KEY"))
.unwrap();
Expand Down
2 changes: 1 addition & 1 deletion src/core/middlewares/general.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ impl FromRequest for GeneralMiddleware {
}
}

pub fn decode_token(jwt: &String) -> AppResult<TokenData<GeneralToken>> {
pub fn decode_token(jwt: &str) -> AppResult<TokenData<GeneralToken>> {
let bytes_public_key = general_purpose::STANDARD
.decode(dotenv!("GENERAL_TOKEN_PUBLIC_KEY"))
.unwrap();
Expand Down
4 changes: 2 additions & 2 deletions src/features/general/general_controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ use crate::{
};

pub async fn test_email(
_: GeneralMiddleware,
__: web::Data<AppState>,
_middleware: GeneralMiddleware,
_state: web::Data<AppState>,
params: Json<SendEmailParams>,
) -> AppResult<HttpResponse> {
params.validate().map_err(|e| APIError::BadRequest {
Expand Down

0 comments on commit 0128be0

Please sign in to comment.