From bf8a8379db1c6e3ee3e0a05431d49abf63734f3a Mon Sep 17 00:00:00 2001 From: Alex Zenla Date: Sat, 14 Dec 2024 18:46:45 -0500 Subject: [PATCH] fix(xenplatform): use cfg attributes for returning supported platforms --- crates/xen/xenplatform/src/lib.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/crates/xen/xenplatform/src/lib.rs b/crates/xen/xenplatform/src/lib.rs index 6361764..b3099b1 100644 --- a/crates/xen/xenplatform/src/lib.rs +++ b/crates/xen/xenplatform/src/lib.rs @@ -56,11 +56,10 @@ impl RuntimePlatformType { } pub fn supported() -> RuntimePlatformType { - if cfg!(target_arch = "x86_64") { - RuntimePlatformType::Pv - } else { - RuntimePlatformType::Unsupported - } + #[cfg(target_arch = "x86_64")] + return RuntimePlatformType::Pv; + #[cfg(not(target_arch = "x86_64"))] + return RuntimePlatformType::Unsupported; } }