Skip to content

Commit 6295dd3

Browse files
committed
chore: implement default for otp_type and otp_algoritmh enums
1 parent c92b07b commit 6295dd3

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/otp/otp_algorithm.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ pub enum OTPAlgorithm {
1313
Md5,
1414
}
1515

16+
impl Default for OTPAlgorithm {
17+
fn default() -> Self {
18+
Self::Sha1
19+
}
20+
}
21+
1622
impl fmt::Display for OTPAlgorithm {
1723
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1824
let to_string = match self {

src/otp/otp_type.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ pub enum OTPType {
2424
Motp,
2525
}
2626

27+
impl Default for OTPType {
28+
fn default() -> Self {
29+
Self::Totp
30+
}
31+
}
32+
2733
impl fmt::Display for OTPType {
2834
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2935
let to_string = match self {

0 commit comments

Comments
 (0)