diff options
Diffstat (limited to 'crates/ra_proc_macro/src/process.rs')
-rw-r--r-- | crates/ra_proc_macro/src/process.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/crates/ra_proc_macro/src/process.rs b/crates/ra_proc_macro/src/process.rs index e8c85be38..b5e8493ac 100644 --- a/crates/ra_proc_macro/src/process.rs +++ b/crates/ra_proc_macro/src/process.rs | |||
@@ -44,8 +44,9 @@ impl Drop for Process { | |||
44 | } | 44 | } |
45 | 45 | ||
46 | impl Process { | 46 | impl Process { |
47 | fn run(process_path: &Path) -> Result<Process, io::Error> { | 47 | fn run<T: AsRef<str>>(process_path: &Path, args: &[T]) -> Result<Process, io::Error> { |
48 | let child = Command::new(process_path.clone()) | 48 | let child = Command::new(process_path.clone()) |
49 | .args(args.iter().map(|it| it.as_ref())) | ||
49 | .stdin(Stdio::piped()) | 50 | .stdin(Stdio::piped()) |
50 | .stdout(Stdio::piped()) | 51 | .stdout(Stdio::piped()) |
51 | .stderr(Stdio::null()) | 52 | .stderr(Stdio::null()) |
@@ -74,10 +75,11 @@ impl Process { | |||
74 | } | 75 | } |
75 | 76 | ||
76 | impl ProcMacroProcessSrv { | 77 | impl ProcMacroProcessSrv { |
77 | pub fn run( | 78 | pub fn run<T: AsRef<str>>( |
78 | process_path: &Path, | 79 | process_path: &Path, |
80 | args: &[T], | ||
79 | ) -> Result<(ProcMacroProcessThread, ProcMacroProcessSrv), io::Error> { | 81 | ) -> Result<(ProcMacroProcessThread, ProcMacroProcessSrv), io::Error> { |
80 | let process = Process::run(process_path)?; | 82 | let process = Process::run(process_path, args)?; |
81 | 83 | ||
82 | let (task_tx, task_rx) = bounded(0); | 84 | let (task_tx, task_rx) = bounded(0); |
83 | let handle = jod_thread::spawn(move || { | 85 | let handle = jod_thread::spawn(move || { |