Skip to content

Commit

Permalink
chore(clippy): make clippy happy (paradigmxyz#3005)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse authored Jun 6, 2023
1 parent 6e3b420 commit adf4328
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions crates/rpc/rpc/src/layers/jwt_secret.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,10 @@ mod tests {
fn from_hex() {
let key = "f79ae8046bc11c9927afe911db7143c51a806c4a537cc08e0d37140b0192f430";
let secret: Result<JwtSecret, _> = JwtSecret::from_hex(key);
assert!(matches!(secret, Ok(_)));
assert!(secret.is_ok());

let secret: Result<JwtSecret, _> = JwtSecret::from_hex(key);
assert!(matches!(secret, Ok(_)));
assert!(secret.is_ok());
}

#[test]
Expand All @@ -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]
Expand Down Expand Up @@ -359,15 +359,15 @@ 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);
}

#[test]
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));
}

Expand Down
4 changes: 2 additions & 2 deletions crates/rpc/rpc/src/layers/jwt_validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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());
}
}

0 comments on commit adf4328

Please sign in to comment.