From 7a5b206250522b7786fe9429fafa7d8826ccd155 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Fri, 6 Jun 2025 06:08:56 +0000 Subject: [PATCH] Fix cargo clippy issue in webauthn-manager --- src/data/webauthn_manager.rs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/data/webauthn_manager.rs b/src/data/webauthn_manager.rs index cb3e3be..35f1db2 100644 --- a/src/data/webauthn_manager.rs +++ b/src/data/webauthn_manager.rs @@ -1,4 +1,3 @@ -use std::io::ErrorKind; use std::sync::Arc; use actix_web::web; @@ -109,15 +108,13 @@ impl WebAuthManager { ) -> Res { let state: RegisterKeyOpaqueData = self.crypto_wrapper.decrypt(opaque_state)?; if state.user_id != user.uid { - return Err(Box::new(std::io::Error::new( - ErrorKind::Other, + return Err(Box::new(std::io::Error::other( "Invalid user for pubkey!", ))); } if state.expire < time() { - return Err(Box::new(std::io::Error::new( - ErrorKind::Other, + return Err(Box::new(std::io::Error::other( "Challenge has expired!", ))); } @@ -157,15 +154,13 @@ impl WebAuthManager { ) -> Res { let state: AuthStateOpaqueData = self.crypto_wrapper.decrypt(opaque_state)?; if &state.user_id != user_id { - return Err(Box::new(std::io::Error::new( - ErrorKind::Other, + return Err(Box::new(std::io::Error::other( "Invalid user for pubkey!", ))); } if state.expire < time() { - return Err(Box::new(std::io::Error::new( - ErrorKind::Other, + return Err(Box::new(std::io::Error::other( "Challenge has expired!", ))); }