From a392adbd7024bee574d43fdffbae6323f85b1ec3 Mon Sep 17 00:00:00 2001 From: Joe Richey Date: Sun, 23 Oct 2022 01:44:05 -0700 Subject: [PATCH] Move 3ds selection above rdrand/js/custom fallback This makes the big cfg_if easier to read. Signed-off-by: Joe Richey --- src/lib.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 074a6a7a..2a05e314 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -251,6 +251,11 @@ cfg_if! { #[path = "espidf.rs"] mod imp; } else if #[cfg(windows)] { #[path = "windows.rs"] mod imp; + } else if #[cfg(all(target_os = "horizon", target_arch = "arm"))] { + // We check for target_arch = "arm" because the Nintendo Switch also + // uses Horizon OS (it is aarch64). + mod util_libc; + #[path = "3ds.rs"] mod imp; } else if #[cfg(all(target_arch = "x86_64", target_env = "sgx"))] { #[path = "rdrand.rs"] mod imp; } else if #[cfg(all(feature = "rdrand", @@ -259,11 +264,6 @@ cfg_if! { } else if #[cfg(all(feature = "js", target_arch = "wasm32", target_os = "unknown"))] { #[path = "js.rs"] mod imp; - } else if #[cfg(all(target_os = "horizon", target_arch = "arm"))] { - // We check for target_arch = "arm" because the Nintendo Switch also - // uses Horizon OS (it is aarch64). - mod util_libc; - #[path = "3ds.rs"] mod imp; } else if #[cfg(feature = "custom")] { use custom as imp; } else if #[cfg(all(target_arch = "wasm32", target_os = "unknown"))] {