From 70df42ce80e5d9c9dacbb14823efeecdc9a9c6b7 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Tue, 6 Jun 2023 01:56:58 +0200 Subject: [PATCH] chore(clippy): make clippy happy --- crates/rpc/rpc/src/layers/jwt_secret.rs | 10 +++++----- crates/rpc/rpc/src/layers/jwt_validator.rs | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/crates/rpc/rpc/src/layers/jwt_secret.rs b/crates/rpc/rpc/src/layers/jwt_secret.rs index 608f90be4342..abca0ff50a29 100644 --- a/crates/rpc/rpc/src/layers/jwt_secret.rs +++ b/crates/rpc/rpc/src/layers/jwt_secret.rs @@ -206,10 +206,10 @@ mod tests { fn from_hex() { let key = "f79ae8046bc11c9927afe911db7143c51a806c4a537cc08e0d37140b0192f430"; let secret: Result = JwtSecret::from_hex(key); - assert!(matches!(secret, Ok(_))); + assert!(secret.is_ok()); let secret: Result = JwtSecret::from_hex(key); - assert!(matches!(secret, Ok(_))); + assert!(secret.is_ok()); } #[test] @@ -234,7 +234,7 @@ mod tests { let hex: String = "0x7365637265747365637265747365637265747365637265747365637265747365".into(); let result = JwtSecret::from_hex(hex); - assert!(matches!(result, Ok(_))); + assert!(result.is_ok()); } #[test] @@ -359,7 +359,7 @@ mod tests { let fpath = Path::new("secret2.hex"); write(fpath, "invalid hex"); let result = JwtSecret::from_file(fpath); - assert!(matches!(result, Err(_))); + assert!(result.is_err()); delete(fpath); } @@ -367,7 +367,7 @@ mod tests { fn provided_file_not_exists() { let fpath = Path::new("secret3.hex"); let result = JwtSecret::from_file(fpath); - assert!(matches!(result, Err(_))); + assert!(result.is_err()); assert!(!exists(fpath)); } diff --git a/crates/rpc/rpc/src/layers/jwt_validator.rs b/crates/rpc/rpc/src/layers/jwt_validator.rs index 16d3b20d4804..54ee63d715e1 100644 --- a/crates/rpc/rpc/src/layers/jwt_validator.rs +++ b/crates/rpc/rpc/src/layers/jwt_validator.rs @@ -85,7 +85,7 @@ mod tests { fn auth_header_not_available() { let headers = HeaderMap::new(); let token = get_bearer(&headers); - assert!(matches!(token, None)); + assert!(token.is_none()); } #[test] @@ -95,6 +95,6 @@ mod tests { let mut headers = HeaderMap::new(); headers.insert(header::AUTHORIZATION, bearer.parse().unwrap()); let token = get_bearer(&headers); - assert!(matches!(token, None)); + assert!(token.is_none()); } }