@@ -9,6 +9,7 @@ use crate::rpc::{ExpansionResult, ExpansionTask, ListMacrosResult, ListMacrosTas
99use io:: { BufRead , BufReader } ;
1010use std:: {
1111 convert:: { TryFrom , TryInto } ,
12+ ffi:: OsStr ,
1213 io:: { self , Write } ,
1314 path:: { Path , PathBuf } ,
1415 process:: { Child , Command , Stdio } ,
@@ -44,9 +45,13 @@ impl Drop for Process {
4445}
4546
4647impl Process {
47- fn run < T : AsRef < str > > ( process_path : & Path , args : & [ T ] ) -> Result < Process , io:: Error > {
48+ fn run < I , S > ( process_path : & Path , args : I ) -> Result < Process , io:: Error >
49+ where
50+ I : IntoIterator < Item = S > ,
51+ S : AsRef < OsStr > ,
52+ {
4853 let child = Command :: new ( process_path. clone ( ) )
49- . args ( args. iter ( ) . map ( |it| it . as_ref ( ) ) )
54+ . args ( args)
5055 . stdin ( Stdio :: piped ( ) )
5156 . stdout ( Stdio :: piped ( ) )
5257 . stderr ( Stdio :: null ( ) )
@@ -75,10 +80,14 @@ impl Process {
7580}
7681
7782impl ProcMacroProcessSrv {
78- pub fn run < T : AsRef < str > > (
83+ pub fn run < I , S > (
7984 process_path : & Path ,
80- args : & [ T ] ,
81- ) -> Result < ( ProcMacroProcessThread , ProcMacroProcessSrv ) , io:: Error > {
85+ args : I ,
86+ ) -> Result < ( ProcMacroProcessThread , ProcMacroProcessSrv ) , io:: Error >
87+ where
88+ I : IntoIterator < Item = S > ,
89+ S : AsRef < OsStr > ,
90+ {
8291 let process = Process :: run ( process_path, args) ?;
8392
8493 let ( task_tx, task_rx) = bounded ( 0 ) ;
0 commit comments