Skip to content

Commit

Permalink
Windows?
Browse files Browse the repository at this point in the history
  • Loading branch information
schneems authored and Richard Schneeman committed Nov 12, 2023
1 parent 88c6c77 commit c9e8d86
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion library/std/src/sys/windows/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use crate::sys::handle::Handle;
use crate::sys::path;
use crate::sys::pipe::{self, AnonPipe};
use crate::sys::stdio;
use crate::sys_common::process::{CommandEnv, CommandEnvs};
use crate::sys_common::process::{CapturedEnvs, CommandEnv, CommandEnvs};
use crate::sys_common::IntoInner;

use core::ffi::c_void;
Expand Down Expand Up @@ -244,6 +244,10 @@ impl Command {
self.env.iter()
}

pub fn capture_envs(&self) -> CapturedEnvs {
self.env.capture_iter()
}

pub fn get_current_dir(&self) -> Option<&Path> {
self.cwd.as_ref().map(|cwd| Path::new(cwd))
}
Expand Down
3 changes: 2 additions & 1 deletion library/std/src/sys_common/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,9 @@ impl CommandEnv {
///
/// See [`Command::capture_envs`][crate::process::Command::capture_envs] documentation for more.
pub struct CapturedEnvs {
iter: crate::collections::btree_map::IntoIter<OsString, OsString>,
iter: crate::collections::btree_map::IntoIter<EnvKey, OsString>,
}

impl Iterator for CapturedEnvs {
type Item = (OsString, OsString);
fn next(&mut self) -> Option<(OsString, OsString)> {
Expand Down

0 comments on commit c9e8d86

Please sign in to comment.