@@ -8,7 +8,7 @@ use std::{fmt, io, mem};
88use rustc_target:: spec:: LldFlavor ;
99
1010#[ derive( Clone ) ]
11- pub struct Command {
11+ pub ( crate ) struct Command {
1212 program : Program ,
1313 args : Vec < OsString > ,
1414 env : Vec < ( OsString , OsString ) > ,
@@ -23,28 +23,28 @@ enum Program {
2323}
2424
2525impl Command {
26- pub fn new < P : AsRef < OsStr > > ( program : P ) -> Command {
26+ pub ( crate ) fn new < P : AsRef < OsStr > > ( program : P ) -> Command {
2727 Command :: _new ( Program :: Normal ( program. as_ref ( ) . to_owned ( ) ) )
2828 }
2929
30- pub fn bat_script < P : AsRef < OsStr > > ( program : P ) -> Command {
30+ pub ( crate ) fn bat_script < P : AsRef < OsStr > > ( program : P ) -> Command {
3131 Command :: _new ( Program :: CmdBatScript ( program. as_ref ( ) . to_owned ( ) ) )
3232 }
3333
34- pub fn lld < P : AsRef < OsStr > > ( program : P , flavor : LldFlavor ) -> Command {
34+ pub ( crate ) fn lld < P : AsRef < OsStr > > ( program : P , flavor : LldFlavor ) -> Command {
3535 Command :: _new ( Program :: Lld ( program. as_ref ( ) . to_owned ( ) , flavor) )
3636 }
3737
3838 fn _new ( program : Program ) -> Command {
3939 Command { program, args : Vec :: new ( ) , env : Vec :: new ( ) , env_remove : Vec :: new ( ) }
4040 }
4141
42- pub fn arg < P : AsRef < OsStr > > ( & mut self , arg : P ) -> & mut Command {
42+ pub ( crate ) fn arg < P : AsRef < OsStr > > ( & mut self , arg : P ) -> & mut Command {
4343 self . _arg ( arg. as_ref ( ) ) ;
4444 self
4545 }
4646
47- pub fn args < I > ( & mut self , args : I ) -> & mut Command
47+ pub ( crate ) fn args < I > ( & mut self , args : I ) -> & mut Command
4848 where
4949 I : IntoIterator < Item : AsRef < OsStr > > ,
5050 {
@@ -58,7 +58,7 @@ impl Command {
5858 self . args . push ( arg. to_owned ( ) ) ;
5959 }
6060
61- pub fn env < K , V > ( & mut self , key : K , value : V ) -> & mut Command
61+ pub ( crate ) fn env < K , V > ( & mut self , key : K , value : V ) -> & mut Command
6262 where
6363 K : AsRef < OsStr > ,
6464 V : AsRef < OsStr > ,
@@ -71,7 +71,7 @@ impl Command {
7171 self . env . push ( ( key. to_owned ( ) , value. to_owned ( ) ) ) ;
7272 }
7373
74- pub fn env_remove < K > ( & mut self , key : K ) -> & mut Command
74+ pub ( crate ) fn env_remove < K > ( & mut self , key : K ) -> & mut Command
7575 where
7676 K : AsRef < OsStr > ,
7777 {
@@ -83,11 +83,11 @@ impl Command {
8383 self . env_remove . push ( key. to_owned ( ) ) ;
8484 }
8585
86- pub fn output ( & mut self ) -> io:: Result < Output > {
86+ pub ( crate ) fn output ( & mut self ) -> io:: Result < Output > {
8787 self . command ( ) . output ( )
8888 }
8989
90- pub fn command ( & self ) -> process:: Command {
90+ pub ( crate ) fn command ( & self ) -> process:: Command {
9191 let mut ret = match self . program {
9292 Program :: Normal ( ref p) => process:: Command :: new ( p) ,
9393 Program :: CmdBatScript ( ref p) => {
@@ -111,17 +111,17 @@ impl Command {
111111
112112 // extensions
113113
114- pub fn get_args ( & self ) -> & [ OsString ] {
114+ pub ( crate ) fn get_args ( & self ) -> & [ OsString ] {
115115 & self . args
116116 }
117117
118- pub fn take_args ( & mut self ) -> Vec < OsString > {
118+ pub ( crate ) fn take_args ( & mut self ) -> Vec < OsString > {
119119 mem:: take ( & mut self . args )
120120 }
121121
122122 /// Returns a `true` if we're pretty sure that this'll blow OS spawn limits,
123123 /// or `false` if we should attempt to spawn and see what the OS says.
124- pub fn very_likely_to_exceed_some_spawn_limit ( & self ) -> bool {
124+ pub ( crate ) fn very_likely_to_exceed_some_spawn_limit ( & self ) -> bool {
125125 // We mostly only care about Windows in this method, on Unix the limits
126126 // can be gargantuan anyway so we're pretty unlikely to hit them
127127 if cfg ! ( unix) {
0 commit comments