Skip to content

Commit 42ae9dc

Browse files
committed
rustc/session: move consts up to improve readability
1 parent e5eb538 commit 42ae9dc

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/librustc/session/filesearch.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -178,22 +178,22 @@ fn find_libdir(sysroot: &Path) -> Cow<'static, str> {
178178
// If --libdir is set during configuration to the value other than
179179
// "lib" (i.e. non-default), this value is used (see issue #16552).
180180

181-
match option_env!("CFG_LIBDIR_RELATIVE") {
182-
Some(libdir) if libdir != "lib" => return libdir.into(),
183-
_ => if sysroot.join(PRIMARY_LIB_DIR).join(RUST_LIB_DIR).exists() {
184-
return PRIMARY_LIB_DIR.into();
185-
} else {
186-
return SECONDARY_LIB_DIR.into();
187-
}
188-
}
189-
190181
#[cfg(target_pointer_width = "64")]
191182
const PRIMARY_LIB_DIR: &'static str = "lib64";
192183

193184
#[cfg(target_pointer_width = "32")]
194185
const PRIMARY_LIB_DIR: &'static str = "lib32";
195186

196187
const SECONDARY_LIB_DIR: &'static str = "lib";
188+
189+
match option_env!("CFG_LIBDIR_RELATIVE") {
190+
Some(libdir) if libdir != "lib" => libdir.into(),
191+
_ => if sysroot.join(PRIMARY_LIB_DIR).join(RUST_LIB_DIR).exists() {
192+
PRIMARY_LIB_DIR.into()
193+
} else {
194+
SECONDARY_LIB_DIR.into()
195+
}
196+
}
197197
}
198198

199199
// The name of rustc's own place to organize libraries.

0 commit comments

Comments
 (0)