Skip to content

Commit

Permalink
Swap impl block order for clearer diff
Browse files Browse the repository at this point in the history
  • Loading branch information
ryoqun committed Dec 16, 2024
1 parent da5c6a8 commit 41e6151
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions unified-scheduler-pool/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1974,16 +1974,6 @@ impl<TH: TaskHandler> InstalledScheduler for PooledScheduler<TH> {
}
}

impl<S, TH> UninstalledScheduler for PooledSchedulerInner<S, TH>
where
S: SpawnableScheduler<TH, Inner = Self>,
TH: TaskHandler,
{
fn return_to_pool(self: Box<Self>) {
self.thread_manager.pool.clone().return_scheduler(*self);
}
}

impl<S, TH> SchedulerInner for PooledSchedulerInner<S, TH>
where
S: SpawnableScheduler<TH>,
Expand Down Expand Up @@ -2020,6 +2010,16 @@ where
}
}

impl<S, TH> UninstalledScheduler for PooledSchedulerInner<S, TH>
where
S: SpawnableScheduler<TH, Inner = Self>,
TH: TaskHandler,
{
fn return_to_pool(self: Box<Self>) {
self.thread_manager.pool.clone().return_scheduler(*self);
}
}

#[cfg(test)]
mod tests {
use {
Expand Down Expand Up @@ -3418,14 +3418,6 @@ mod tests {
}
}

impl<const TRIGGER_RACE_CONDITION: bool> UninstalledScheduler
for AsyncScheduler<TRIGGER_RACE_CONDITION>
{
fn return_to_pool(self: Box<Self>) {
self.3.clone().return_scheduler(*self)
}
}

impl<const TRIGGER_RACE_CONDITION: bool> SchedulerInner for AsyncScheduler<TRIGGER_RACE_CONDITION> {
fn id(&self) -> SchedulerId {
42
Expand All @@ -3448,6 +3440,14 @@ mod tests {
}
}

impl<const TRIGGER_RACE_CONDITION: bool> UninstalledScheduler
for AsyncScheduler<TRIGGER_RACE_CONDITION>
{
fn return_to_pool(self: Box<Self>) {
self.3.clone().return_scheduler(*self)
}
}

impl<const TRIGGER_RACE_CONDITION: bool> SpawnableScheduler<DefaultTaskHandler>
for AsyncScheduler<TRIGGER_RACE_CONDITION>
{
Expand Down

0 comments on commit 41e6151

Please sign in to comment.