Skip to content

Commit 3d9000c

Browse files
committed
wip: added trait
1 parent 134d86d commit 3d9000c

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/env_var.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,24 @@
11
use std::collections::HashSet;
22
use std::env;
3+
use std::ffi::OsStr;
34
use std::path::PathBuf;
45
use std::process::Command;
56

67
use crate::process;
78

89
pub const RUST_RECURSION_COUNT_MAX: u32 = 20;
910

11+
trait ProcessEnvs {
12+
type Item;
13+
type Iter: Iterator<Item = Self::Item>;
14+
15+
fn get_envs(&self) -> Self::Iter;
16+
fn env<K, V>(&mut self, key: K, val: V) -> &mut Self
17+
where
18+
K: AsRef<OsStr>,
19+
V: AsRef<OsStr>;
20+
}
21+
1022
#[allow(unused)]
1123
pub fn append_path(name: &str, value: Vec<PathBuf>, cmd: &mut Command) {
1224
let old_value = process().var_os(name);

0 commit comments

Comments
 (0)