Skip to content

Commit 2753fff

Browse files
committed
refactor: simplify match statement in steam otp maker
1 parent a3b26da commit 2753fff

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/otp/algorithms/steam_otp_maker.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@ use super::totp_maker::totp;
88
const STEAM_ALPHABET: &str = "23456789BCDFGHJKMNPQRTVWXY";
99

1010
pub fn steam(secret: &str, algorithm: OTPAlgorithm, digits: usize) -> Result<String, OtpError> {
11-
match totp(secret, algorithm) {
12-
Ok(v) => Ok(to_steam_string(v as usize, digits)),
13-
Err(e) => Err(e),
14-
}
11+
totp(secret, algorithm).map(|v| to_steam_string(v as usize, digits))
1512
}
1613

1714
fn to_steam_string(mut code: usize, digits: usize) -> String {

0 commit comments

Comments
 (0)