aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorveetaha <[email protected]>2020-05-09 20:19:11 +0100
committerveetaha <[email protected]>2020-05-09 20:20:11 +0100
commit2f7c30c5158a752491dfea98de5a1c6044d104f7 (patch)
tree041f118f1f38dc9a8c335ec16ad3d5b9c95496bd /crates
parenta42729a59d8874f03482275d13010456718d4ad9 (diff)
Simplify match
Diffstat (limited to 'crates')
-rw-r--r--crates/ra_toolchain/src/lib.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/crates/ra_toolchain/src/lib.rs b/crates/ra_toolchain/src/lib.rs
index 3c307a0ea..3d2865e09 100644
--- a/crates/ra_toolchain/src/lib.rs
+++ b/crates/ra_toolchain/src/lib.rs
@@ -53,10 +53,9 @@ fn lookup_in_path(exec: &str) -> bool {
53 let paths = env::var_os("PATH").unwrap_or_default(); 53 let paths = env::var_os("PATH").unwrap_or_default();
54 let mut candidates = env::split_paths(&paths).flat_map(|path| { 54 let mut candidates = env::split_paths(&paths).flat_map(|path| {
55 let candidate = path.join(&exec); 55 let candidate = path.join(&exec);
56 let with_exe = if env::consts::EXE_EXTENSION == "" { 56 let with_exe = match env::consts::EXE_EXTENSION {
57 None 57 "" => None,
58 } else { 58 it => Some(candidate.with_extension(it)),
59 Some(candidate.with_extension(env::consts::EXE_EXTENSION))
60 }; 59 };
61 iter::once(candidate).chain(with_exe) 60 iter::once(candidate).chain(with_exe)
62 }); 61 });