mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-13 05:38:46 +00:00
Simplify match
This commit is contained in:
parent
a42729a59d
commit
2f7c30c515
1 changed files with 3 additions and 4 deletions
|
@ -53,10 +53,9 @@ fn lookup_in_path(exec: &str) -> bool {
|
|||
let paths = env::var_os("PATH").unwrap_or_default();
|
||||
let mut candidates = env::split_paths(&paths).flat_map(|path| {
|
||||
let candidate = path.join(&exec);
|
||||
let with_exe = if env::consts::EXE_EXTENSION == "" {
|
||||
None
|
||||
} else {
|
||||
Some(candidate.with_extension(env::consts::EXE_EXTENSION))
|
||||
let with_exe = match env::consts::EXE_EXTENSION {
|
||||
"" => None,
|
||||
it => Some(candidate.with_extension(it)),
|
||||
};
|
||||
iter::once(candidate).chain(with_exe)
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue