Rename config function

This commit is contained in:
Sam Hedin 2020-06-06 13:26:42 +02:00
parent 2770a6f5e4
commit e4c951fe93
3 changed files with 7 additions and 7 deletions

View File

@ -4,7 +4,7 @@ use std::fmt::Debug;
pub trait Conf: Debug + Send {
fn env(&self) -> Option<Value>;
fn path(&self) -> Option<Value>;
fn direnv_whitelist(&self) -> Option<Value>;
fn nu_env_dirs(&self) -> Option<Value>;
fn reload(&self);
}
@ -13,8 +13,8 @@ impl Conf for Box<dyn Conf> {
(**self).env()
}
fn direnv_whitelist(&self) -> Option<Value> {
(**self).direnv_whitelist()
fn nu_env_dirs(&self) -> Option<Value> {
(**self).nu_env_dirs()
}
fn path(&self) -> Option<Value> {

View File

@ -20,8 +20,8 @@ impl Conf for NuConfig {
self.path()
}
fn direnv_whitelist(&self) -> Option<Value> {
self.direnv_whitelist()
fn nu_env_dirs(&self) -> Option<Value> {
self.nu_env_dirs()
}
fn reload(&self) {
@ -56,7 +56,7 @@ impl NuConfig {
None
}
pub fn direnv_whitelist(&self) -> Option<Value> {
pub fn nu_env_dirs(&self) -> Option<Value> {
let vars = self.vars.lock();
if let Some(dirs) = vars.get("nu_env_dirs") {
return Some(dirs.clone());

View File

@ -54,7 +54,7 @@ impl Environment {
Environment {
environment_vars: env,
path_vars: path,
direnv: DirectorySpecificEnvironment::new(configuration.direnv_whitelist()),
direnv: DirectorySpecificEnvironment::new(configuration.nu_env_dirs()),
}
}