mirror of
https://github.com/sharkdp/hyperfine.git
synced 2026-11-01 08:50:19 +00:00
Move Stdio extraction to enum
This commit is contained in:
1 parent
e1da8ba00f
commit
9b8f2a9ee2
2 files changed
+12
-6
No files matched your search
+10
-1
@@ -1,4 +1,4 @@
|
||||
use std::process::Command;
|
||||
use std::process::{Command, Stdio};
|
||||
use std::{cmp, fmt};
|
||||
|
||||
use anyhow::ensure;
|
||||
@@ -124,6 +124,15 @@ impl Default for CommandOutputPolicy {
|
||||
}
|
||||
}
|
||||
|
||||
impl CommandOutputPolicy {
|
||||
pub fn get_stdout_stderr(&self) -> (Stdio, Stdio) {
|
||||
match self {
|
||||
CommandOutputPolicy::Discard => (Stdio::null(), Stdio::null()),
|
||||
CommandOutputPolicy::Forward => (Stdio::inherit(), Stdio::inherit()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub enum ExecutorKind {
|
||||
Shell(Shell),
|
||||
Mock(Option<String>),
|
||||
|
||||
Reference in new issue
Block a user