mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-11-10 07:04:22 +00:00
Use the send method
This commit is contained in:
parent
66859ed9d3
commit
1549f10e95
1 changed files with 23 additions and 31 deletions
|
@ -119,14 +119,12 @@ impl NotifyActor {
|
||||||
self.watched_dir_entries.clear();
|
self.watched_dir_entries.clear();
|
||||||
self.watched_file_entries.clear();
|
self.watched_file_entries.clear();
|
||||||
|
|
||||||
self.sender
|
self.send(loader::Message::Progress {
|
||||||
.send(loader::Message::Progress {
|
n_total,
|
||||||
n_total,
|
n_done: LoadingProgress::Started,
|
||||||
n_done: LoadingProgress::Started,
|
config_version,
|
||||||
config_version,
|
dir: None,
|
||||||
dir: None,
|
});
|
||||||
})
|
|
||||||
.unwrap();
|
|
||||||
|
|
||||||
let (entry_tx, entry_rx) = unbounded();
|
let (entry_tx, entry_rx) = unbounded();
|
||||||
let (watch_tx, watch_rx) = unbounded();
|
let (watch_tx, watch_rx) = unbounded();
|
||||||
|
@ -142,31 +140,25 @@ impl NotifyActor {
|
||||||
entry,
|
entry,
|
||||||
do_watch,
|
do_watch,
|
||||||
|file| {
|
|file| {
|
||||||
self.sender
|
self.send(loader::Message::Progress {
|
||||||
.send(loader::Message::Progress {
|
n_total,
|
||||||
n_total,
|
n_done: LoadingProgress::Progress(
|
||||||
n_done: LoadingProgress::Progress(
|
processed.load(std::sync::atomic::Ordering::Relaxed),
|
||||||
processed
|
),
|
||||||
.load(std::sync::atomic::Ordering::Relaxed),
|
dir: Some(file),
|
||||||
),
|
config_version,
|
||||||
dir: Some(file),
|
});
|
||||||
config_version,
|
|
||||||
})
|
|
||||||
.unwrap()
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
self.sender.send(loader::Message::Loaded { files }).unwrap();
|
self.send(loader::Message::Loaded { files });
|
||||||
self.sender
|
self.send(loader::Message::Progress {
|
||||||
.send(loader::Message::Progress {
|
n_total,
|
||||||
n_total,
|
n_done: LoadingProgress::Progress(
|
||||||
n_done: LoadingProgress::Progress(
|
processed.fetch_add(1, std::sync::atomic::Ordering::AcqRel) + 1,
|
||||||
processed.fetch_add(1, std::sync::atomic::Ordering::AcqRel)
|
),
|
||||||
+ 1,
|
config_version,
|
||||||
),
|
dir: None,
|
||||||
config_version,
|
});
|
||||||
dir: None,
|
|
||||||
})
|
|
||||||
.unwrap();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
drop(watch_tx);
|
drop(watch_tx);
|
||||||
|
|
Loading…
Reference in a new issue