Skip to content

Commit 2707164

Browse files
committed
clean up to use a single line if
1 parent ce0ff23 commit 2707164

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/totp.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,7 @@ impl TOTP {
168168
/// in seconds.
169169
pub fn time_until_refresh_with_start(&self, time: u64, time_start: u64) -> u64 {
170170
let time_until = (time - time_start) % self.period;
171-
if time_until == 0 {
172-
return self.period;
173-
}
174-
time_until
171+
if time_until == 0 { self.period } else { time_until }
175172
}
176173
}
177174

0 commit comments

Comments
 (0)