Skip to content

Commit 2a4fcf7

Browse files
committed
fmt
1 parent 9b5f991 commit 2a4fcf7

File tree

1 file changed

+14
-15
lines changed
  • src/librustc_codegen_ssa/back

1 file changed

+14
-15
lines changed

src/librustc_codegen_ssa/back/link.rs

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -975,17 +975,20 @@ pub fn print_native_static_libs(sess: &Session, all_native_libs: &[NativeLibrary
975975
// We prefer system mingw-w64 libraries if they are available to avoid this issue.
976976
fn get_crt_libs_path(sess: &Session) -> Option<PathBuf> {
977977
fn find_exe_in_path<P>(exe_name: P) -> Option<PathBuf>
978-
where P: AsRef<Path>,
978+
where
979+
P: AsRef<Path>,
979980
{
980981
env::var_os("PATH").and_then(|paths| {
981-
env::split_paths(&paths).filter_map(|dir| {
982-
let full_path = dir.join(&exe_name);
983-
if full_path.is_file() {
984-
Some(fix_windows_verbatim_for_gcc(&full_path))
985-
} else {
986-
None
987-
}
988-
}).next()
982+
env::split_paths(&paths)
983+
.filter_map(|dir| {
984+
let full_path = dir.join(&exe_name);
985+
if full_path.is_file() {
986+
Some(fix_windows_verbatim_for_gcc(&full_path))
987+
} else {
988+
None
989+
}
990+
})
991+
.next()
989992
})
990993
}
991994

@@ -1000,15 +1003,11 @@ fn get_crt_libs_path(sess: &Session) -> Option<PathBuf> {
10001003
Some(Err(_)) => None,
10011004
_ => {
10021005
if let (linker, LinkerFlavor::Gcc) = linker_and_flavor(&sess) {
1003-
let linker_path = if cfg!(windows) {
1004-
linker.with_extension("exe")
1005-
} else {
1006-
linker
1007-
};
1006+
let linker_path = if cfg!(windows) { linker.with_extension("exe") } else { linker };
10081007
if let Some(linker_path) = find_exe_in_path(linker_path) {
10091008
let mingw_arch = match &sess.target.target.arch {
10101009
x if x == "x86" => "i686",
1011-
x => x
1010+
x => x,
10121011
};
10131012
let mingw_dir = [mingw_arch, "-w64-mingw32"].concat();
10141013
// Here we have path/bin/gcc but we need path/

0 commit comments

Comments
 (0)