Remove dir-s/ectories/ectories-support features (#3647)

This commit is contained in:
Jakub Žádník
2021-06-19 02:29:29 +03:00
committed by GitHub
parent bd44bcee32
commit 4140834e4c
14 changed files with 20 additions and 102 deletions

View File

@ -15,8 +15,8 @@ byte-unit = "4.0.9"
chrono = "0.4.19"
common-path = "1.0.0"
derive-new = "0.5.8"
directories-next = { version = "2.0.0", optional = true }
dirs-next = { version = "2.0.0", optional = true }
directories-next = "2.0.0"
dirs-next = "2.0.0"
getset = "0.1.1"
indexmap = { version = "1.6.1", features = ["serde-1"] }
log = "0.4.14"
@ -48,6 +48,4 @@ features = ["strings", "checked_arithmetic"]
users = "0.11.0"
[features]
directories = ["directories-next"]
dirs = ["dirs-next"]
dataframe = ["nu-protocol/dataframe", "polars"]

View File

@ -161,7 +161,6 @@ pub fn value_to_toml_value(v: &Value) -> Result<toml::Value, ShellError> {
}
}
#[cfg(feature = "directories")]
pub fn config_path() -> Result<PathBuf, ShellError> {
use directories_next::ProjectDirs;
@ -175,13 +174,6 @@ pub fn config_path() -> Result<PathBuf, ShellError> {
Ok(path)
}
#[cfg(not(feature = "directories"))]
pub fn config_path() -> Result<PathBuf, ShellError> {
// FIXME: unsure if this should be error or a simple default
Ok(std::path::PathBuf::from("/"))
}
pub fn default_path() -> Result<PathBuf, ShellError> {
default_path_for(&None)
}
@ -197,7 +189,6 @@ pub fn default_path_for(file: &Option<PathBuf>) -> Result<PathBuf, ShellError> {
Ok(filename)
}
#[cfg(feature = "directories")]
pub fn user_data() -> Result<PathBuf, ShellError> {
use directories_next::ProjectDirs;
@ -214,13 +205,6 @@ pub fn user_data() -> Result<PathBuf, ShellError> {
Ok(path)
}
#[cfg(not(feature = "directories"))]
pub fn user_data() -> Result<PathBuf, ShellError> {
// FIXME: unsure if this should be error or a simple default
Ok(std::path::PathBuf::from("/"))
}
#[derive(Debug, Clone)]
pub enum Status {
LastModified(std::time::SystemTime),