diff options
author | Edwin Cheng <[email protected]> | 2020-04-16 21:08:01 +0100 |
---|---|---|
committer | Edwin Cheng <[email protected]> | 2020-04-16 21:08:01 +0100 |
commit | b4c5ee33ae128df4e82c992d0c13f6c9df0f9f02 (patch) | |
tree | 4504f149c0deae8ff8526c172085e023ff3665a3 /crates/ra_proc_macro/src/lib.rs | |
parent | 177becea98bddcd995a2abec59c6b60bac6b5a2b (diff) |
Fix extern_process args
Diffstat (limited to 'crates/ra_proc_macro/src/lib.rs')
-rw-r--r-- | crates/ra_proc_macro/src/lib.rs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/crates/ra_proc_macro/src/lib.rs b/crates/ra_proc_macro/src/lib.rs index 14a675db2..b200fd126 100644 --- a/crates/ra_proc_macro/src/lib.rs +++ b/crates/ra_proc_macro/src/lib.rs | |||
@@ -12,6 +12,7 @@ pub mod msg; | |||
12 | use process::{ProcMacroProcessSrv, ProcMacroProcessThread}; | 12 | use process::{ProcMacroProcessSrv, ProcMacroProcessThread}; |
13 | use ra_tt::{SmolStr, Subtree}; | 13 | use ra_tt::{SmolStr, Subtree}; |
14 | use std::{ | 14 | use std::{ |
15 | ffi::OsStr, | ||
15 | path::{Path, PathBuf}, | 16 | path::{Path, PathBuf}, |
16 | sync::Arc, | 17 | sync::Arc, |
17 | }; | 18 | }; |
@@ -56,10 +57,14 @@ pub struct ProcMacroClient { | |||
56 | } | 57 | } |
57 | 58 | ||
58 | impl ProcMacroClient { | 59 | impl ProcMacroClient { |
59 | pub fn extern_process<T: AsRef<str>>( | 60 | pub fn extern_process<I, S>( |
60 | process_path: &Path, | 61 | process_path: &Path, |
61 | args: &[T], | 62 | args: I, |
62 | ) -> Result<ProcMacroClient, std::io::Error> { | 63 | ) -> Result<ProcMacroClient, std::io::Error> |
64 | where | ||
65 | I: IntoIterator<Item = S>, | ||
66 | S: AsRef<OsStr>, | ||
67 | { | ||
63 | let (thread, process) = ProcMacroProcessSrv::run(process_path, args)?; | 68 | let (thread, process) = ProcMacroProcessSrv::run(process_path, args)?; |
64 | Ok(ProcMacroClient { | 69 | Ok(ProcMacroClient { |
65 | kind: ProcMacroClientKind::Process { process: Arc::new(process), thread }, | 70 | kind: ProcMacroClientKind::Process { process: Arc::new(process), thread }, |