tfa: rustfmt

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2022-04-10 12:34:41 +02:00
parent 4554034d32
commit 6f8173f67a
2 changed files with 5 additions and 16 deletions

View File

@ -524,10 +524,7 @@ fn test_otp() {
let parsed: Totp = uri.parse().expect("failed to parse otp uri"); let parsed: Totp = uri.parse().expect("failed to parse otp uri");
assert_eq!(parsed, hotp); assert_eq!(parsed, hotp);
assert_eq!(parsed.issuer, None); assert_eq!(parsed.issuer, None);
assert_eq!( assert_eq!(parsed.account_name.as_deref(), Some("My Account"));
parsed.account_name.as_deref(),
Some("My Account")
);
const SECRET_2: &str = "a60b1b20679b1a64e21a"; const SECRET_2: &str = "a60b1b20679b1a64e21a";
const EXPECTED: &str = "7757717"; const EXPECTED: &str = "7757717";
@ -557,12 +554,6 @@ fn test_otp() {
let uri = totp.to_uri().expect("failed to create otpauth uri"); let uri = totp.to_uri().expect("failed to create otpauth uri");
let parsed: Totp = uri.parse().expect("failed to parse otp uri"); let parsed: Totp = uri.parse().expect("failed to parse otp uri");
assert_eq!(parsed, totp); assert_eq!(parsed, totp);
assert_eq!( assert_eq!(parsed.issuer.as_deref(), Some("An Issuer"));
parsed.issuer.as_deref(), assert_eq!(parsed.account_name.as_deref(), Some("The Account Name"));
Some("An Issuer")
);
assert_eq!(
parsed.account_name.as_deref(),
Some("The Account Name")
);
} }

View File

@ -521,8 +521,7 @@ mod test {
response: super::RegistrationResponse, response: super::RegistrationResponse,
} }
let ts: TestChallenge = let ts: TestChallenge = serde_json::from_str(data).expect("failed to parse json test data");
serde_json::from_str(data).expect("failed to parse json test data");
let context = super::U2f::new(TEST_APPID.to_string(), TEST_APPID.to_string()); let context = super::U2f::new(TEST_APPID.to_string(), TEST_APPID.to_string());
let res = context let res = context
@ -545,8 +544,7 @@ mod test {
response: super::AuthResponse, response: super::AuthResponse,
} }
let ts: TestChallenge = let ts: TestChallenge = serde_json::from_str(data).expect("failed to parse json test data");
serde_json::from_str(data).expect("failed to parse json test data");
let context = super::U2f::new(TEST_APPID.to_string(), TEST_APPID.to_string()); let context = super::U2f::new(TEST_APPID.to_string(), TEST_APPID.to_string());
let res = context let res = context