From 2f7c30c5158a752491dfea98de5a1c6044d104f7 Mon Sep 17 00:00:00 2001 From: veetaha Date: Sat, 9 May 2020 22:19:11 +0300 Subject: Simplify match --- crates/ra_toolchain/src/lib.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'crates/ra_toolchain/src') 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 { 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) }); -- cgit v1.2.3