Skip to content

Commit a610e46

Browse files
committed
wip: use trait
1 parent fcfc032 commit a610e46

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/env_var.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,23 @@
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;
14+
fn get_envs(&self) -> Self::Iter<Item=Self::Item>;
15+
fn env<K, V>(&mut self, key: K, val: V) -> &mut Self
16+
where
17+
K: AsRef<OsStr>,
18+
V: AsRef<OsStr>;
19+
}
20+
1021
#[allow(unused)]
1122
pub fn append_path(name: &str, value: Vec<PathBuf>, cmd: &mut Command) {
1223
let old_value = process().var_os(name);

0 commit comments

Comments
 (0)