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

@ -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),