aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_analysis/src/job.rs
diff options
context:
space:
mode:
authorJeremy A. Kolb <[email protected]>2018-10-15 22:44:23 +0100
committerJeremy A. Kolb <[email protected]>2018-10-16 14:41:10 +0100
commit61f3a438d3a729a6be941bca1ff4c6a97a33f221 (patch)
tree6551967cc8c6e921b66071453ad7888a9121d326 /crates/ra_analysis/src/job.rs
parent39cb6c6d3f78b193f5873c3492e530bbd24d5dd2 (diff)
Cargo Format
Run `cargo fmt` and ignore generated files
Diffstat (limited to 'crates/ra_analysis/src/job.rs')
-rw-r--r--crates/ra_analysis/src/job.rs14
1 files changed, 9 insertions, 5 deletions
diff --git a/crates/ra_analysis/src/job.rs b/crates/ra_analysis/src/job.rs
index ea1652a26..2871f9839 100644
--- a/crates/ra_analysis/src/job.rs
+++ b/crates/ra_analysis/src/job.rs
@@ -14,15 +14,20 @@ impl JobHandle {
14 pub fn new() -> (JobHandle, JobToken) { 14 pub fn new() -> (JobHandle, JobToken) {
15 let (sender_alive, receiver_alive) = bounded(0); 15 let (sender_alive, receiver_alive) = bounded(0);
16 let (sender_canceled, receiver_canceled) = bounded(0); 16 let (sender_canceled, receiver_canceled) = bounded(0);
17 let token = JobToken { _job_alive: sender_alive, job_canceled: receiver_canceled }; 17 let token = JobToken {
18 let handle = JobHandle { job_alive: receiver_alive, _job_canceled: sender_canceled }; 18 _job_alive: sender_alive,
19 job_canceled: receiver_canceled,
20 };
21 let handle = JobHandle {
22 job_alive: receiver_alive,
23 _job_canceled: sender_canceled,
24 };
19 (handle, token) 25 (handle, token)
20 } 26 }
21 pub fn has_completed(&self) -> bool { 27 pub fn has_completed(&self) -> bool {
22 is_closed(&self.job_alive) 28 is_closed(&self.job_alive)
23 } 29 }
24 pub fn cancel(self) { 30 pub fn cancel(self) {}
25 }
26} 31}
27 32
28impl JobToken { 33impl JobToken {
@@ -31,7 +36,6 @@ impl JobToken {
31 } 36 }
32} 37}
33 38
34
35// We don't actually send messages through the channels, 39// We don't actually send messages through the channels,
36// and instead just check if the channel is closed, 40// and instead just check if the channel is closed,
37// so we use uninhabited enum as a message type 41// so we use uninhabited enum as a message type