Skip to content

Commit b5ff8a1

Browse files
committed
feat: Command::as_std/as_mut_std
1 parent 83857bb commit b5ff8a1

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/lib.rs

+10
Original file line numberDiff line numberDiff line change
@@ -1077,6 +1077,16 @@ impl Command {
10771077
let child = Child::new(self);
10781078
async { child?.output().await }
10791079
}
1080+
1081+
/// Cheaply convert to a `&std::process::Command` for places where the type from the standard library is expected.
1082+
pub fn as_std(&self) -> &std::process::Command {
1083+
&self.inner
1084+
}
1085+
1086+
/// Cheaply convert to a `&mut std::process::Command` for places where the type from the standard library is expected.
1087+
pub fn as_mut_std(&mut self) -> &mut std::process::Command {
1088+
&mut self.inner
1089+
}
10801090
}
10811091

10821092
impl From<std::process::Command> for Command {

0 commit comments

Comments
 (0)