diff --git a/crates/ra_toolchain/src/lib.rs b/crates/ra_toolchain/src/lib.rs index 3c307a0eac..3d2865e09c 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 { 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) });