aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/job.rs
diff options
context:
space:
mode:
authorBlaž Hrastnik2022-01-14 03:25:59 +0000
committerBlaž Hrastnik2022-01-16 05:19:48 +0000
commite7eab95b943ff15396c5d512a9c95650ab98a902 (patch)
tree88a485634f4eb4a98c86fa5e3fc235a0363cf6bc /helix-term/src/job.rs
parentf5b0821860940782567a0baa17280aef04f845e3 (diff)
Update to rust 1.58, fix a bunch of optional lints
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 4fa38174..f5a0a425 100644
--- a/helix-term/src/job.rs
+++ b/helix-term/src/job.rs
@@ -22,8 +22,8 @@ pub struct Jobs {
}
impl Job {
- pub fn new<F: Future<Output = anyhow::Result<()>> + Send + 'static>(f: F) -> Job {
- Job {
+ pub fn new<F: Future<Output = anyhow::Result<()>> + Send + 'static>(f: F) -> Self {
+ Self {
future: f.map(|r| r.map(|()| None)).boxed(),
wait: false,
}
@@ -31,22 +31,22 @@ impl Job {
pub fn with_callback<F: Future<Output = anyhow::Result<Callback>> + Send + 'static>(
f: F,
- ) -> Job {
- Job {
+ ) -> Self {
+ Self {
future: f.map(|r| r.map(Some)).boxed(),
wait: false,
}
}
- pub fn wait_before_exiting(mut self) -> Job {
+ pub fn wait_before_exiting(mut self) -> Self {
self.wait = true;
self
}
}
impl Jobs {
- pub fn new() -> Jobs {
- Jobs::default()
+ pub fn new() -> Self {
+ Self::default()
}
pub fn spawn<F: Future<Output = anyhow::Result<()>> + Send + 'static>(&mut self, f: F) {