aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/job.rs
diff options
context:
space:
mode:
authorNathan Vegdahl2021-07-06 03:27:49 +0000
committerNathan Vegdahl2021-07-06 03:27:49 +0000
commit85d5b399de70ff075a455ce2858549d1ed012fe3 (patch)
tree4824fcb47f39551d3b31a62931adaf0ee406c02b /helix-term/src/job.rs
parent6e15c9b8745e9708ee5271c8701d41a8393cb038 (diff)
parent3c31f501164080998975883eb6f93c49bd8d3efb (diff)
Merge branch 'master' into great_line_ending_and_cursor_range_cleanup
Diffstat (limited to 'helix-term/src/job.rs')
-rw-r--r--helix-term/src/job.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/helix-term/src/job.rs b/helix-term/src/job.rs
index c2873513..2ac41926 100644
--- a/helix-term/src/job.rs
+++ b/helix-term/src/job.rs
@@ -16,9 +16,9 @@ pub struct Job {
#[derive(Default)]
pub struct Jobs {
- futures: FuturesUnordered<JobFuture>,
+ pub futures: FuturesUnordered<JobFuture>,
/// These are the ones that need to complete before we exit.
- wait_futures: FuturesUnordered<JobFuture>,
+ pub wait_futures: FuturesUnordered<JobFuture>,
}
impl Job {
@@ -77,11 +77,11 @@ impl Jobs {
}
}
- pub fn next_job(
- &mut self,
- ) -> impl Future<Output = Option<anyhow::Result<Option<Callback>>>> + '_ {
- future::select(self.futures.next(), self.wait_futures.next())
- .map(|either| either.factor_first().0)
+ pub async fn next_job(&mut self) -> Option<anyhow::Result<Option<Callback>>> {
+ tokio::select! {
+ event = self.futures.next() => { event }
+ event = self.wait_futures.next() => { event }
+ }
}
pub fn add(&mut self, j: Job) {