Skip to content

Commit f85caa6

Browse files
committed
clippy
1 parent 5c074b4 commit f85caa6

File tree

2 files changed

+9
-19
lines changed

2 files changed

+9
-19
lines changed

src/channel.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,15 +393,15 @@ impl<T> fmt::Display for TrySendError<T> {
393393
#[inline]
394394
fn format_send_error<T>(e: &SendError<T>, f: &mut fmt::Formatter) -> fmt::Result {
395395
match *e {
396-
SendError::Io(ref io_err) => write!(f, "{}", io_err),
396+
SendError::Io(ref io_err) => write!(f, "{io_err}"),
397397
SendError::Disconnected(..) => write!(f, "Disconnected"),
398398
}
399399
}
400400

401401
#[inline]
402402
fn format_try_send_error<T>(e: &TrySendError<T>, f: &mut fmt::Formatter) -> fmt::Result {
403403
match *e {
404-
TrySendError::Io(ref io_err) => write!(f, "{}", io_err),
404+
TrySendError::Io(ref io_err) => write!(f, "{io_err}"),
405405
TrySendError::Full(..) => write!(f, "Full"),
406406
TrySendError::Disconnected(..) => write!(f, "Disconnected"),
407407
}

src/timer.rs

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ impl<T> Timer<T> {
219219

220220
self.schedule_readiness(tick);
221221

222-
trace!("inserted timout; slot={}; token={:?}", slot, token);
222+
trace!("inserted timout; slot={slot}; token={token:?}");
223223

224224
// Return the new timeout
225225
Timeout { token, tick }
@@ -266,7 +266,7 @@ impl<T> Timer<T> {
266266
while self.tick <= target_tick {
267267
let curr = self.next;
268268

269-
trace!("ticking; curr={:?}", curr);
269+
trace!("ticking; curr={curr:?}");
270270

271271
if curr == EMPTY {
272272
self.tick += 1;
@@ -292,7 +292,7 @@ impl<T> Timer<T> {
292292
let links = self.entries[curr.into()].links;
293293

294294
if links.tick <= self.tick {
295-
trace!("triggering; token={:?}", curr);
295+
trace!("triggering; token={curr:?}");
296296

297297
// Unlink will also advance self.next
298298
self.unlink(&links, curr);
@@ -357,7 +357,7 @@ impl<T> Timer<T> {
357357
}
358358

359359
// Attempt to move the wakeup time forward
360-
trace!("advancing the wakeup time; target={}; curr={}", tick, curr);
360+
trace!("advancing the wakeup time; target={tick}; curr={curr}");
361361
match inner.wakeup_state.compare_exchange_weak(
362362
curr,
363363
tick as usize,
@@ -490,11 +490,7 @@ fn spawn_wakeup_thread(
490490

491491
let now_tick = current_tick(start, tick_ms);
492492

493-
trace!(
494-
"wakeup thread: sleep_until_tick={:?}; now_tick={:?}",
495-
sleep_until_tick,
496-
now_tick
497-
);
493+
trace!( "wakeup thread: sleep_until_tick={sleep_until_tick:?}; now_tick={now_tick:?}");
498494

499495
if now_tick < sleep_until_tick {
500496
// Calling park_timeout with u64::MAX leads to undefined
@@ -504,19 +500,13 @@ fn spawn_wakeup_thread(
504500
match tick_ms.checked_mul(sleep_until_tick - now_tick) {
505501
Some(sleep_duration) => {
506502
trace!(
507-
"sleeping; tick_ms={}; now_tick={}; sleep_until_tick={}; duration={:?}",
508-
tick_ms,
509-
now_tick,
510-
sleep_until_tick,
511-
sleep_duration
503+
"sleeping; tick_ms={tick_ms}; now_tick={now_tick}; sleep_until_tick={sleep_until_tick}; duration={sleep_duration:?}"
512504
);
513505
thread::park_timeout(Duration::from_millis(sleep_duration));
514506
}
515507
None => {
516508
trace!(
517-
"sleeping; tick_ms={}; now_tick={}; blocking sleep",
518-
tick_ms,
519-
now_tick
509+
"sleeping; tick_ms={tick_ms}; now_tick={now_tick}; blocking sleep"
520510
);
521511
thread::park();
522512
}

0 commit comments

Comments
 (0)