mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 19:09:54 +00:00
chore(clippy): make clippy happy (#3005)
This commit is contained in:
@ -206,10 +206,10 @@ mod tests {
|
|||||||
fn from_hex() {
|
fn from_hex() {
|
||||||
let key = "f79ae8046bc11c9927afe911db7143c51a806c4a537cc08e0d37140b0192f430";
|
let key = "f79ae8046bc11c9927afe911db7143c51a806c4a537cc08e0d37140b0192f430";
|
||||||
let secret: Result<JwtSecret, _> = JwtSecret::from_hex(key);
|
let secret: Result<JwtSecret, _> = JwtSecret::from_hex(key);
|
||||||
assert!(matches!(secret, Ok(_)));
|
assert!(secret.is_ok());
|
||||||
|
|
||||||
let secret: Result<JwtSecret, _> = JwtSecret::from_hex(key);
|
let secret: Result<JwtSecret, _> = JwtSecret::from_hex(key);
|
||||||
assert!(matches!(secret, Ok(_)));
|
assert!(secret.is_ok());
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@ -234,7 +234,7 @@ mod tests {
|
|||||||
let hex: String =
|
let hex: String =
|
||||||
"0x7365637265747365637265747365637265747365637265747365637265747365".into();
|
"0x7365637265747365637265747365637265747365637265747365637265747365".into();
|
||||||
let result = JwtSecret::from_hex(hex);
|
let result = JwtSecret::from_hex(hex);
|
||||||
assert!(matches!(result, Ok(_)));
|
assert!(result.is_ok());
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@ -359,7 +359,7 @@ mod tests {
|
|||||||
let fpath = Path::new("secret2.hex");
|
let fpath = Path::new("secret2.hex");
|
||||||
write(fpath, "invalid hex");
|
write(fpath, "invalid hex");
|
||||||
let result = JwtSecret::from_file(fpath);
|
let result = JwtSecret::from_file(fpath);
|
||||||
assert!(matches!(result, Err(_)));
|
assert!(result.is_err());
|
||||||
delete(fpath);
|
delete(fpath);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -367,7 +367,7 @@ mod tests {
|
|||||||
fn provided_file_not_exists() {
|
fn provided_file_not_exists() {
|
||||||
let fpath = Path::new("secret3.hex");
|
let fpath = Path::new("secret3.hex");
|
||||||
let result = JwtSecret::from_file(fpath);
|
let result = JwtSecret::from_file(fpath);
|
||||||
assert!(matches!(result, Err(_)));
|
assert!(result.is_err());
|
||||||
assert!(!exists(fpath));
|
assert!(!exists(fpath));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -85,7 +85,7 @@ mod tests {
|
|||||||
fn auth_header_not_available() {
|
fn auth_header_not_available() {
|
||||||
let headers = HeaderMap::new();
|
let headers = HeaderMap::new();
|
||||||
let token = get_bearer(&headers);
|
let token = get_bearer(&headers);
|
||||||
assert!(matches!(token, None));
|
assert!(token.is_none());
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@ -95,6 +95,6 @@ mod tests {
|
|||||||
let mut headers = HeaderMap::new();
|
let mut headers = HeaderMap::new();
|
||||||
headers.insert(header::AUTHORIZATION, bearer.parse().unwrap());
|
headers.insert(header::AUTHORIZATION, bearer.parse().unwrap());
|
||||||
let token = get_bearer(&headers);
|
let token = get_bearer(&headers);
|
||||||
assert!(matches!(token, None));
|
assert!(token.is_none());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user