From 7155d5df89e6b36018f8844774c4164eba64b49f Mon Sep 17 00:00:00 2001 From: Edwin Cheng Date: Fri, 27 Mar 2020 13:58:12 +0800 Subject: Remove unused struct --- crates/ra_proc_macro/src/process.rs | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'crates') diff --git a/crates/ra_proc_macro/src/process.rs b/crates/ra_proc_macro/src/process.rs index d028b365c..daae9a7e0 100644 --- a/crates/ra_proc_macro/src/process.rs +++ b/crates/ra_proc_macro/src/process.rs @@ -16,7 +16,7 @@ use std::{ #[derive(Debug, Default)] pub(crate) struct ProcMacroProcessSrv { - inner: Option, + inner: Option>, } #[derive(Debug)] @@ -30,11 +30,6 @@ enum Task { Close, } -#[derive(Debug)] -struct Handle { - sender: Sender, -} - struct Process { path: PathBuf, child: Child, @@ -89,7 +84,7 @@ impl ProcMacroProcessSrv { client_loop(task_rx, process); }); - let srv = ProcMacroProcessSrv { inner: Some(Handle { sender: task_tx.clone() }) }; + let srv = ProcMacroProcessSrv { inner: Some(task_tx.clone()) }; let thread = ProcMacroProcessThread { handle: Some(handle), sender: task_tx }; Ok((thread, srv)) @@ -127,8 +122,8 @@ impl ProcMacroProcessSrv { T: serde::Serialize, R: serde::de::DeserializeOwned + Default, { - let handle = match &self.inner { - None => return Err(ra_tt::ExpansionError::Unknown("No handle is found.".to_string())), + let sender = match &self.inner { + None => return Err(ra_tt::ExpansionError::Unknown("No sender is found.".to_string())), Some(it) => it, }; @@ -140,7 +135,7 @@ impl ProcMacroProcessSrv { let (result_tx, result_rx) = bounded(0); - handle.sender.send(Task::Request { req: req.into(), result_tx }).map_err(|err| { + sender.send(Task::Request { req: req.into(), result_tx }).map_err(|err| { ra_tt::ExpansionError::Unknown(format!( "Fail to send task in channel, reason : {:#?} ", err -- cgit v1.2.3