Skip to content

Commit 212330f

Browse files
committed
more idiomatic way of checking elapsed time
1 parent 6897593 commit 212330f

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -466,8 +466,7 @@ impl ImeClient {
466466
// > xcb_xim_open -> open_callback -> xcb_xim_create_ic -> create_ic_callback
467467
// The initialization logic will fail if we call xcb_xim_open again
468468
// while it's already in progress, so allow 5 seconds for the job to finish.
469-
let duration = now.duration_since(prev_try);
470-
if duration.lt(&Duration::from_secs(5)) {
469+
if prev_try.elapsed() < Duration::from_secs(5) {
471470
return;
472471
}
473472
if let Some(logger) = LOGGER.lock().as_mut() {

0 commit comments

Comments
 (0)