Add JobPriority::Foreground
This commit is contained in:
parent
d6f4b2b6b7
commit
6124572c02
11
src/tui/lib/external/musicbrainz/daemon/mod.rs
vendored
11
src/tui/lib/external/musicbrainz/daemon/mod.rs
vendored
@ -35,7 +35,6 @@ impl Job {
|
|||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
enum JobPriority {
|
enum JobPriority {
|
||||||
#[cfg(test)]
|
|
||||||
Foreground,
|
Foreground,
|
||||||
Background,
|
Background,
|
||||||
}
|
}
|
||||||
@ -298,22 +297,12 @@ impl JobQueue {
|
|||||||
.or_else(|| self.background_queue.pop_front())
|
.or_else(|| self.background_queue.pop_front())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
|
||||||
fn push_back(&mut self, job: Job) {
|
fn push_back(&mut self, job: Job) {
|
||||||
match job.priority {
|
match job.priority {
|
||||||
JobPriority::Foreground => self.foreground_queue.push_back(job.instance),
|
JobPriority::Foreground => self.foreground_queue.push_back(job.instance),
|
||||||
JobPriority::Background => self.background_queue.push_back(job.instance),
|
JobPriority::Background => self.background_queue.push_back(job.instance),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// GRCOV_EXCL_START
|
|
||||||
#[cfg(not(test))]
|
|
||||||
fn push_back(&mut self, job: Job) {
|
|
||||||
match job.priority {
|
|
||||||
JobPriority::Background => self.background_queue.push_back(job.instance),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// GRCOV_EXCL_STOP
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
Loading…
Reference in New Issue
Block a user