summaryrefslogtreecommitdiffstats
path: root/src/env.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2022-01-08 19:02:52 -0500
committerJesse Luehrs <doy@tozt.net>2022-01-08 19:02:52 -0500
commit1839a1f5b65c84871de6a547df2192d06ab14092 (patch)
treeed370d2d6fca7c2b3f3aa098f9d521aaeca94778 /src/env.rs
parent96b45b2d3dd1ff0ee9312150f2a642058df7668b (diff)
downloadnbsh-1839a1f5b65c84871de6a547df2192d06ab14092.tar.gz
nbsh-1839a1f5b65c84871de6a547df2192d06ab14092.zip
implement for loops
Diffstat (limited to 'src/env.rs')
-rw-r--r--src/env.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/env.rs b/src/env.rs
index 41484d0..fd9a047 100644
--- a/src/env.rs
+++ b/src/env.rs
@@ -80,6 +80,14 @@ impl Env {
}
}
+ pub fn set_var<T: Into<std::ffi::OsString>>(&mut self, k: T, v: T) {
+ match self {
+ Self::V0(env) => {
+ env.vars.insert(k.into(), v.into());
+ }
+ }
+ }
+
pub fn set_vars(
&mut self,
it: impl Iterator<Item = (std::ffi::OsString, std::ffi::OsString)>,