mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-23 13:11:15 -03:00
autoload: simplify conditional compilation
This commit is contained in:
@@ -341,15 +341,14 @@ fn check(
|
||||
cmd: &wstr,
|
||||
allow_stale: bool,
|
||||
) -> Option<AutoloadableFileInfo> {
|
||||
let asset_dir = cfg!(feature = "embed-data").then_some(()).and_then(|()| {
|
||||
if env_var_name == "fish_function_path" {
|
||||
Some(AssetDir::Functions)
|
||||
} else if cfg!(feature = "embed-data") && env_var_name == "fish_complete_path" {
|
||||
Some(AssetDir::Completions)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
});
|
||||
let asset_dir =
|
||||
cfg!(feature = "embed-data")
|
||||
.then_some(())
|
||||
.and_then(|()| match env_var_name {
|
||||
s if s == "fish_function_path" => Some(AssetDir::Functions),
|
||||
s if s == "fish_complete_path" => Some(AssetDir::Completions),
|
||||
_ => None,
|
||||
});
|
||||
|
||||
// Check hits.
|
||||
if let Some(value) = self.known_files.get(cmd) {
|
||||
|
||||
Reference in New Issue
Block a user