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

@ -105,18 +105,7 @@ fn run_with_stdin(
let process_args = command_args
.iter()
.map(|(arg, _is_literal)| {
let home_dir;
#[cfg(feature = "dirs")]
{
home_dir = dirs_next::home_dir;
}
#[cfg(not(feature = "dirs"))]
{
home_dir = || Some(std::path::PathBuf::from("/"));
}
let arg = expand_tilde(arg.deref(), home_dir);
let arg = expand_tilde(arg.deref(), dirs_next::home_dir);
#[cfg(not(windows))]
{

View File

@ -1,6 +1,5 @@
use super::{operate, PathSubcommandArguments};
use crate::prelude::*;
#[cfg(feature = "dirs")]
use nu_engine::filesystem::path::expand_tilde;
use nu_engine::filesystem::path::resolve_dots;
use nu_engine::WholeStreamCommand;
@ -104,7 +103,6 @@ fn action(path: &Path, tag: Tag, args: &PathExpandArguments) -> Value {
))
} else {
// "best effort" mode, just expand tilde and resolve single/double dots
#[cfg(feature = "dirs")]
let path = match expand_tilde(path) {
Some(expanded) => expanded,
None => path.into(),

View File

@ -189,16 +189,6 @@ fn features_enabled() -> Vec<String> {
names.push("ctrlc".to_string());
}
#[cfg(feature = "dirs")]
{
names.push("dirs".to_string());
}
#[cfg(feature = "directories")]
{
names.push("directories".to_string());
}
#[cfg(feature = "ptree")]
{
names.push("ptree".to_string());