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"] term-support = ["nu-cli/term", "nu-command/term"]
uuid-support = ["nu-cli/uuid_crate", "nu-command/uuid_crate"] uuid-support = ["nu-cli/uuid_crate", "nu-command/uuid_crate"]
which-support = [ which-support = [
"nu-cli/ichwh",
"nu-cli/which", "nu-cli/which",
"nu-command/ichwh",
"nu-command/which", "nu-command/which",
"nu-engine/which", "nu-engine/which",
] ]

View File

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

View File

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

View File

@ -192,11 +192,6 @@ fn features_enabled() -> Vec<String> {
names.push("which".to_string()); names.push("which".to_string());
} }
#[cfg(feature = "ichwh")]
{
names.push("ichwh".to_string());
}
#[cfg(feature = "zip")] #[cfg(feature = "zip")]
{ {
names.push("zip".to_string()); 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> { fn get_first_entry_in_path(item: &str, tag: Tag) -> Option<Value> {
use futures::executor::block_on; which::which(item)
.map(|path| entry_path!(item, path, tag))
block_on(ichwh::which(item)) .ok()
.unwrap_or(None)
.map(|path| entry_path!(item, path.into(), tag))
} }
#[cfg(not(feature = "ichwh"))] #[cfg(not(feature = "which"))]
fn get_first_entry_in_path(_: &str, _: Tag) -> Option<Value> { fn get_first_entry_in_path(_: &str, _: Tag) -> Option<Value> {
None None
} }
#[cfg(feature = "ichwh")] #[cfg(feature = "which")]
fn get_all_entries_in_path(item: &str, tag: Tag) -> Vec<Value> { fn get_all_entries_in_path(item: &str, tag: Tag) -> Vec<Value> {
use futures::executor::block_on; which::which_all(&item)
.map(|iter| {
block_on(ichwh::which_all(&item)) iter.map(|path| entry_path!(item, path, tag.clone()))
.unwrap_or_default()
.into_iter()
.map(|path| entry_path!(item, path.into(), tag.clone()))
.collect() .collect()
})
.unwrap_or_default()
} }
#[cfg(not(feature = "which"))]
#[cfg(not(feature = "ichwh"))]
fn get_all_entries_in_path(_: &str, _: Tag) -> Vec<Value> { fn get_all_entries_in_path(_: &str, _: Tag) -> Vec<Value> {
vec![] vec![]
} }