Skip to content

Commit 40e1b84

Browse files
committed
chore: fix clippy lint
1 parent e4d550d commit 40e1b84

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/otp/otp_element.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -232,11 +232,7 @@ impl OTPElement {
232232
.checked_pow(self.digits as u32)
233233
.ok_or(OtpError::InvalidDigits)?;
234234
let s = (value as u64 % exponential).to_string();
235-
Ok("0".repeat(
236-
(self.digits as usize)
237-
.checked_sub(s.chars().count())
238-
.unwrap_or(0),
239-
) + s.as_str())
235+
Ok("0".repeat((self.digits as usize).saturating_sub(s.chars().count())) + s.as_str())
240236
}
241237
}
242238

0 commit comments

Comments
 (0)