mirror of
https://github.com/nushell/nushell.git
synced 2025-08-19 16:06:12 +02:00
Make get_env_var
return a reference to a Value
(#13987)
# Description Title says it all, changes `EngineState::get_env_var` to return a `Option<&'a Value>` instead of an owned `Option<Value>`. This avoids some unnecessary clones. I also made a similar change to the `PluginExecutionContext` trait.
This commit is contained in:
@@ -348,7 +348,7 @@ pub fn nu_repl() {
|
||||
.coerce_str()
|
||||
.unwrap_or_else(|err| outcome_err(&engine_state, &err));
|
||||
let _ = std::env::set_current_dir(path.as_ref());
|
||||
engine_state.add_env_var("PWD".into(), cwd);
|
||||
engine_state.add_env_var("PWD".into(), cwd.clone());
|
||||
}
|
||||
top_stack = Arc::new(Stack::with_changes_from_child(top_stack, stack));
|
||||
}
|
||||
|
Reference in New Issue
Block a user