about summary refs log tree commit diff
diff options
context:
space:
mode:
authorljedrz <ljedrz@gmail.com>2018-10-10 15:35:56 +0200
committerljedrz <ljedrz@gmail.com>2018-10-15 10:19:16 +0200
commit42ae9dc508728bc5c3b88a947ddfbef36e6356c4 (patch)
tree47103e89c47e7aafbca7500d158000914c612c3d
parente5eb5385630a22b8d0e6d08fe88ce171f96c79d3 (diff)
downloadrust-42ae9dc508728bc5c3b88a947ddfbef36e6356c4.tar.gz
rust-42ae9dc508728bc5c3b88a947ddfbef36e6356c4.zip
rustc/session: move consts up to improve readability
-rw-r--r--src/librustc/session/filesearch.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/librustc/session/filesearch.rs b/src/librustc/session/filesearch.rs
index f7a2a2d1bf1..f410c270bce 100644
--- a/src/librustc/session/filesearch.rs
+++ b/src/librustc/session/filesearch.rs
@@ -178,15 +178,6 @@ fn find_libdir(sysroot: &Path) -> Cow<'static, str> {
     // If --libdir is set during configuration to the value other than
     // "lib" (i.e. non-default), this value is used (see issue #16552).
 
-    match option_env!("CFG_LIBDIR_RELATIVE") {
-        Some(libdir) if libdir != "lib" => return libdir.into(),
-        _ => if sysroot.join(PRIMARY_LIB_DIR).join(RUST_LIB_DIR).exists() {
-            return PRIMARY_LIB_DIR.into();
-        } else {
-            return SECONDARY_LIB_DIR.into();
-        }
-    }
-
     #[cfg(target_pointer_width = "64")]
     const PRIMARY_LIB_DIR: &'static str = "lib64";
 
@@ -194,6 +185,15 @@ fn find_libdir(sysroot: &Path) -> Cow<'static, str> {
     const PRIMARY_LIB_DIR: &'static str = "lib32";
 
     const SECONDARY_LIB_DIR: &'static str = "lib";
+
+    match option_env!("CFG_LIBDIR_RELATIVE") {
+        Some(libdir) if libdir != "lib" => libdir.into(),
+        _ => if sysroot.join(PRIMARY_LIB_DIR).join(RUST_LIB_DIR).exists() {
+            PRIMARY_LIB_DIR.into()
+        } else {
+            SECONDARY_LIB_DIR.into()
+        }
+    }
 }
 
 // The name of rustc's own place to organize libraries.