Skip to content

Commit b2ca3bb

Browse files
committed
make clippy happy
1 parent 4432969 commit b2ca3bb

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/calls.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,8 @@ impl CallInfo {
4949
}
5050

5151
fn remaining_ring_seconds(&self) -> i64 {
52-
let mut remaining_seconds = self.msg.timestamp_sent + RINGING_SECONDS - time();
53-
if remaining_seconds < 0 {
54-
remaining_seconds = 0;
55-
}
56-
if remaining_seconds > RINGING_SECONDS {
57-
remaining_seconds = RINGING_SECONDS;
58-
}
59-
return remaining_seconds;
52+
let remaining_seconds = self.msg.timestamp_sent + RINGING_SECONDS - time();
53+
remaining_seconds.clamp(0, RINGING_SECONDS)
6054
}
6155
}
6256

0 commit comments

Comments
 (0)