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
5 changed files with 13 additions and 26 deletions

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![]
}