aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_proc_macro/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_proc_macro/src/lib.rs')
-rw-r--r--crates/ra_proc_macro/src/lib.rs11
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;
12use process::{ProcMacroProcessSrv, ProcMacroProcessThread}; 12use process::{ProcMacroProcessSrv, ProcMacroProcessThread};
13use ra_tt::{SmolStr, Subtree}; 13use ra_tt::{SmolStr, Subtree};
14use std::{ 14use 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
58impl ProcMacroClient { 59impl 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 },