Skip to content

Commit f2d9ad8

Browse files
committed
Inline single-use construction of OsProcess
1 parent 137a0b0 commit f2d9ad8

File tree

1 file changed

+4
-16
lines changed

1 file changed

+4
-16
lines changed

src/currentprocess/mod.rs

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@ pub enum Process {
3232

3333
impl Process {
3434
pub fn os() -> Self {
35-
Self::Os(OsProcess::new())
35+
Self::Os(OsProcess {
36+
stderr_is_a_tty: stderr_isatty(),
37+
stdout_is_a_tty: stdout_isatty(),
38+
})
3639
}
3740

3841
pub fn name(&self) -> Option<String> {
@@ -217,21 +220,6 @@ pub struct OsProcess {
217220
pub(self) stdout_is_a_tty: bool,
218221
}
219222

220-
impl OsProcess {
221-
pub fn new() -> Self {
222-
OsProcess {
223-
stderr_is_a_tty: stderr_isatty(),
224-
stdout_is_a_tty: stdout_isatty(),
225-
}
226-
}
227-
}
228-
229-
impl Default for OsProcess {
230-
fn default() -> Self {
231-
OsProcess::new()
232-
}
233-
}
234-
235223
// ------------ test process ----------------
236224
#[cfg(feature = "test")]
237225
#[derive(Clone, Debug, Default)]

0 commit comments

Comments
 (0)