File tree 3 files changed +7
-19
lines changed
3 files changed +7
-19
lines changed Original file line number Diff line number Diff line change @@ -1180,15 +1180,16 @@ mod tests {
1180
1180
1181
1181
extern "system" {
1182
1182
fn WaitForDebugEvent ( lpDebugEvent : * mut DEBUG_EVENT , dwMilliseconds : DWORD ) -> BOOL ;
1183
- fn ContinueDebugEvent ( dwProcessId : DWORD , dwThreadId : DWORD , dwContinueStatus : DWORD ) -> BOOL ;
1183
+ fn ContinueDebugEvent ( dwProcessId : DWORD , dwThreadId : DWORD ,
1184
+ dwContinueStatus : DWORD ) -> BOOL ;
1184
1185
}
1185
1186
1186
1187
const DEBUG_PROCESS : DWORD = 1 ;
1187
1188
const EXIT_PROCESS_DEBUG_EVENT : DWORD = 5 ;
1188
1189
const DBG_EXCEPTION_NOT_HANDLED : DWORD = 0x80010001 ;
1189
1190
1190
1191
let mut child = Command :: new ( "cmd" )
1191
- . add_creation_flags ( DEBUG_PROCESS )
1192
+ . creation_flags ( DEBUG_PROCESS )
1192
1193
. stdin ( Stdio :: piped ( ) ) . spawn ( ) . unwrap ( ) ;
1193
1194
child. stdin . take ( ) . unwrap ( ) . write_all ( b"exit\r \n " ) . unwrap ( ) ;
1194
1195
let mut events = 0 ;
Original file line number Diff line number Diff line change @@ -106,23 +106,13 @@ pub trait CommandExt {
106
106
/// These will always be ORed with `CREATE_UNICODE_ENVIRONMENT`.
107
107
/// [1]: https://msdn.microsoft.com/en-us/library/windows/desktop/ms684863(v=vs.85).aspx
108
108
#[ unstable( feature = "windows_process_extensions" , issue = "37827" ) ]
109
- fn set_creation_flags ( & mut self , flags : u32 ) -> & mut process:: Command ;
110
- /// Add `flags` to the the [process creation flags][1] to be passed to `CreateProcess`.
111
- ///
112
- /// These will always be ORed with `CREATE_UNICODE_ENVIRONMENT`.
113
- /// [1]: https://msdn.microsoft.com/en-us/library/windows/desktop/ms684863(v=vs.85).aspx
114
- #[ unstable( feature = "windows_process_extensions" , issue = "37827" ) ]
115
- fn add_creation_flags ( & mut self , flags : u32 ) -> & mut process:: Command ;
109
+ fn creation_flags ( & mut self , flags : u32 ) -> & mut process:: Command ;
116
110
}
117
111
118
112
#[ unstable( feature = "windows_process_extensions" , issue = "37827" ) ]
119
113
impl CommandExt for process:: Command {
120
- fn set_creation_flags ( & mut self , flags : u32 ) -> & mut process:: Command {
121
- self . as_inner_mut ( ) . set_creation_flags ( flags) ;
122
- self
123
- }
124
- fn add_creation_flags ( & mut self , flags : u32 ) -> & mut process:: Command {
125
- self . as_inner_mut ( ) . add_creation_flags ( flags) ;
114
+ fn creation_flags ( & mut self , flags : u32 ) -> & mut process:: Command {
115
+ self . as_inner_mut ( ) . creation_flags ( flags) ;
126
116
self
127
117
}
128
118
}
Original file line number Diff line number Diff line change @@ -126,12 +126,9 @@ impl Command {
126
126
pub fn stderr ( & mut self , stderr : Stdio ) {
127
127
self . stderr = Some ( stderr) ;
128
128
}
129
- pub fn set_creation_flags ( & mut self , flags : u32 ) {
129
+ pub fn creation_flags ( & mut self , flags : u32 ) {
130
130
self . flags = flags;
131
131
}
132
- pub fn add_creation_flags ( & mut self , flags : u32 ) {
133
- self . flags = self . flags | flags;
134
- }
135
132
136
133
pub fn spawn ( & mut self , default : Stdio , needs_stdin : bool )
137
134
-> io:: Result < ( Process , StdioPipes ) > {
You can’t perform that action at this time.
0 commit comments