diff options
| author | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2025-06-06 14:20:48 +0000 |
|---|---|---|
| committer | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2025-06-06 14:20:48 +0000 |
| commit | e4c4c4c677f00a35aef0cfbe5e5ab3b30eafda4c (patch) | |
| tree | b629006a8d3b3336e91b21732681e8d4f8cdfe73 /compiler/rustc_interface/src/util.rs | |
| parent | dff8ee5b01b7251937860da41afd55958c13456a (diff) | |
| download | rust-e4c4c4c677f00a35aef0cfbe5e5ab3b30eafda4c.tar.gz rust-e4c4c4c677f00a35aef0cfbe5e5ab3b30eafda4c.zip | |
Fix review comments
Diffstat (limited to 'compiler/rustc_interface/src/util.rs')
| -rw-r--r-- | compiler/rustc_interface/src/util.rs | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/compiler/rustc_interface/src/util.rs b/compiler/rustc_interface/src/util.rs index f769c6156ae..8bdc24d47d9 100644 --- a/compiler/rustc_interface/src/util.rs +++ b/compiler/rustc_interface/src/util.rs @@ -345,14 +345,10 @@ pub fn rustc_path<'a>() -> Option<&'a Path> { } fn get_rustc_path_inner(bin_path: &str) -> Option<PathBuf> { - Some(filesearch::get_or_default_sysroot()).iter().find_map(|sysroot| { - let candidate = sysroot.join(bin_path).join(if cfg!(target_os = "windows") { - "rustc.exe" - } else { - "rustc" - }); - candidate.exists().then_some(candidate) - }) + let candidate = filesearch::get_or_default_sysroot() + .join(bin_path) + .join(if cfg!(target_os = "windows") { "rustc.exe" } else { "rustc" }); + candidate.exists().then_some(candidate) } #[allow(rustc::untranslatable_diagnostic)] // FIXME: make this translatable |
