1use crate::ffi::OsString;
2use crate::{fmt, vec};
3
4pub struct Env {
5 iter: vec::IntoIter<(OsString, OsString)>,
6}
7
8impl Env {
9 pub(super) fn new(env: Vec<(OsString, OsString)>) -> Self {
10 Env { iter: env.into_iter() }
11 }
12}
13
14impl fmt::Debug for Env {
15 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
16 f.debug_list().entries(self.iter.as_slice()).finish()
17 }
18}
19
20impl Iterator for Env {
21 type Item = (OsString, OsString);
22 fn next(&mut self) -> Option<(OsString, OsString)> {
23 self.iter.next()
24 }
25 fn size_hint(&self) -> (usize, Option<usize>) {
26 self.iter.size_hint()
27 }
28}