mirror of
https://github.com/nushell/nushell.git
synced 2025-08-16 16:01:55 +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:
@ -11,7 +11,7 @@ use nu_utils::get_ls_colors;
|
||||
pub fn create_lscolors(engine_state: &EngineState, stack: &Stack) -> LsColors {
|
||||
let colors = stack
|
||||
.get_env_var(engine_state, "LS_COLORS")
|
||||
.and_then(|v| env_to_string("LS_COLORS", &v, engine_state, stack).ok());
|
||||
.and_then(|v| env_to_string("LS_COLORS", v, engine_state, stack).ok());
|
||||
|
||||
get_ls_colors(colors)
|
||||
}
|
||||
|
Reference in New Issue
Block a user