ichwh removed (#3349)

* ichwh removed

* removed unnecessary into() on PathBuf
This commit is contained in:
ccde177b5fb9b8c55078417b4c9fee 2021-04-22 20:14:20 +03:00 committed by GitHub
parent 599c43ce04
commit df2f3d25b0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 13 additions and 26 deletions

View file

@ -82,9 +82,7 @@ rustyline-support = ["nu-cli/rustyline-support", "nu-command/rustyline-support"]
term-support = ["nu-cli/term", "nu-command/term"]
uuid-support = ["nu-cli/uuid_crate", "nu-command/uuid_crate"]
which-support = [
"nu-cli/ichwh",
"nu-cli/which",
"nu-command/ichwh",
"nu-command/which",
"nu-engine/which",
]

View file

@ -57,7 +57,6 @@ getset = "0.1.1"
glob = "0.3.0"
htmlescape = "0.3.1"
ical = "0.7.0"
ichwh = { version = "0.3.4", optional = true }
indexmap = { version = "1.6.1", features = ["serde-1"] }
itertools = "0.10.0"
lazy_static = "1.*"

View file

@ -53,7 +53,6 @@ getset = "0.1.1"
glob = "0.3.0"
htmlescape = "0.3.1"
ical = "0.7.0"
ichwh = { version = "0.3.4", optional = true }
indexmap = { version = "1.6.1", features = ["serde-1"] }
itertools = "0.10.0"
lazy_static = "1.*"
@ -97,7 +96,7 @@ trash = { version = "1.3.0", optional = true }
unicode-segmentation = "1.7.1"
url = "2.2.0"
uuid_crate = { package = "uuid", version = "0.8.2", features = ["v4"], optional = true }
which = { version = "4.0.2", optional = true }
which = { version = "4.1.0", optional = true }
zip = { version = "0.5.9", optional = true }
[target.'cfg(unix)'.dependencies]

View file

@ -192,11 +192,6 @@ fn features_enabled() -> Vec<String> {
names.push("which".to_string());
}
#[cfg(feature = "ichwh")]
{
names.push("ichwh".to_string());
}
#[cfg(feature = "zip")]
{
names.push("zip".to_string());

View file

@ -135,32 +135,28 @@ macro_rules! entry_path {
};
}
#[cfg(feature = "ichwh")]
#[cfg(feature = "which")]
fn get_first_entry_in_path(item: &str, tag: Tag) -> Option<Value> {
use futures::executor::block_on;
block_on(ichwh::which(item))
.unwrap_or(None)
.map(|path| entry_path!(item, path.into(), tag))
which::which(item)
.map(|path| entry_path!(item, path, tag))
.ok()
}
#[cfg(not(feature = "ichwh"))]
#[cfg(not(feature = "which"))]
fn get_first_entry_in_path(_: &str, _: Tag) -> Option<Value> {
None
}
#[cfg(feature = "ichwh")]
#[cfg(feature = "which")]
fn get_all_entries_in_path(item: &str, tag: Tag) -> Vec<Value> {
use futures::executor::block_on;
block_on(ichwh::which_all(&item))
which::which_all(&item)
.map(|iter| {
iter.map(|path| entry_path!(item, path, tag.clone()))
.collect()
})
.unwrap_or_default()
.into_iter()
.map(|path| entry_path!(item, path.into(), tag.clone()))
.collect()
}
#[cfg(not(feature = "ichwh"))]
#[cfg(not(feature = "which"))]
fn get_all_entries_in_path(_: &str, _: Tag) -> Vec<Value> {
vec![]
}