Skip to content

Commit

Permalink
io: format code
Browse files Browse the repository at this point in the history
  • Loading branch information
nurmohammed840 authored Nov 13, 2024
1 parent 603cf98 commit 0126d4a
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions tokio/src/runtime/io/scheduled_io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ impl ScheduledIo {
/// - `f`: a closure returning a new readiness value given the previous
/// readiness.
pub(super) fn set_readiness(&self, tick_op: Tick, f: impl Fn(Ready) -> Ready) {
let update = |curr| {
let _ = self.readiness.fetch_update(AcqRel, Acquire, |curr| {
// If the io driver is shut down, then you are only allowed to clear readiness.
debug_assert!(SHUTDOWN.unpack(curr) == 0 || matches!(tick_op, Tick::Clear(_)));

Expand All @@ -220,12 +220,8 @@ impl ScheduledIo {
Tick::Clear(t) => t as usize,
Tick::Set => tick.wrapping_add(1) % MAX_TICK,
};

let ready = Ready::from_usize(READINESS.unpack(curr));
Some(TICK.pack(new_tick, f(ready).as_usize()))
};
let _ = self.readiness.fetch_update(AcqRel, Acquire, |curr| {
...
});
}

Expand Down

0 comments on commit 0126d4a

Please sign in to comment.