From 69e6924dd596cab20333c81b4557008b7a67bad0 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 25 Jun 2020 08:24:27 +0200 Subject: Use Handle/Actor terminology for flycheck --- crates/ra_flycheck/src/lib.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'crates/ra_flycheck') diff --git a/crates/ra_flycheck/src/lib.rs b/crates/ra_flycheck/src/lib.rs index 0e2ee8698..6751e5c38 100644 --- a/crates/ra_flycheck/src/lib.rs +++ b/crates/ra_flycheck/src/lib.rs @@ -48,21 +48,21 @@ impl fmt::Display for FlycheckConfig { /// diagnostics based on the output. /// The spawned thread is shut down when this struct is dropped. #[derive(Debug)] -pub struct Flycheck { +pub struct FlycheckHandle { // XXX: drop order is significant cmd_send: Sender, handle: jod_thread::JoinHandle<()>, pub task_recv: Receiver, } -impl Flycheck { - pub fn new(config: FlycheckConfig, workspace_root: PathBuf) -> Flycheck { +impl FlycheckHandle { + pub fn spawn(config: FlycheckConfig, workspace_root: PathBuf) -> FlycheckHandle { let (task_send, task_recv) = unbounded::(); let (cmd_send, cmd_recv) = unbounded::(); let handle = jod_thread::spawn(move || { - FlycheckThread::new(config, workspace_root).run(&task_send, &cmd_recv); + FlycheckActor::new(config, workspace_root).run(&task_send, &cmd_recv); }); - Flycheck { task_recv, cmd_send, handle } + FlycheckHandle { task_recv, cmd_send, handle } } /// Schedule a re-start of the cargo check worker. @@ -95,7 +95,7 @@ pub enum CheckCommand { Update, } -struct FlycheckThread { +struct FlycheckActor { config: FlycheckConfig, workspace_root: PathBuf, last_update_req: Option, @@ -109,9 +109,9 @@ struct FlycheckThread { check_process: Option>, } -impl FlycheckThread { - fn new(config: FlycheckConfig, workspace_root: PathBuf) -> FlycheckThread { - FlycheckThread { +impl FlycheckActor { + fn new(config: FlycheckConfig, workspace_root: PathBuf) -> FlycheckActor { + FlycheckActor { config, workspace_root, last_update_req: None, -- cgit v1.2.3