mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 14:40:06 +02:00
ichwh removed (#3349)
* ichwh removed * removed unnecessary into() on PathBuf
This commit is contained in:
committed by
GitHub
parent
599c43ce04
commit
df2f3d25b0
@ -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());
|
||||
|
@ -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![]
|
||||
}
|
||||
|
Reference in New Issue
Block a user