From ab754ac2e392d92846619004b24ea9642ec3a350 Mon Sep 17 00:00:00 2001 From: Zhaofeng Li Date: Tue, 19 Apr 2022 00:29:35 -0700 Subject: [PATCH] Squelch dead code warnings on non-Linux platforms (aka macOS) --- src/command/mod.rs | 4 +++- src/nix/hive/mod.rs | 1 + src/nix/mod.rs | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/command/mod.rs b/src/command/mod.rs index fe65b56..2f8371d 100644 --- a/src/command/mod.rs +++ b/src/command/mod.rs @@ -1,10 +1,12 @@ pub mod build; pub mod apply; pub mod eval; -pub mod apply_local; pub mod upload_keys; pub mod exec; pub mod nix_info; +#[cfg(target_os = "linux")] +pub mod apply_local; + #[cfg(debug_assertions)] pub mod test_progress; diff --git a/src/nix/hive/mod.rs b/src/nix/hive/mod.rs index 565ca89..145a477 100644 --- a/src/nix/hive/mod.rs +++ b/src/nix/hive/mod.rs @@ -248,6 +248,7 @@ impl Hive { } /// Retrieve deployment info for a single node. + #[cfg_attr(not(target_os = "linux"), allow(dead_code))] pub async fn deployment_info_single(&self, node: &NodeName) -> ColmenaResult> { let expr = format!("hive.nodes.\"{}\".config.deployment or null", node.as_str()); self.nix_instantiate(&expr).eval_with_builders().await? diff --git a/src/nix/mod.rs b/src/nix/mod.rs index 5bf15ee..c58dfdd 100644 --- a/src/nix/mod.rs +++ b/src/nix/mod.rs @@ -153,6 +153,8 @@ impl Deref for NodeName { impl NodeConfig { pub fn tags(&self) -> &[String] { &self.tags } + + #[cfg_attr(not(target_os = "linux"), allow(dead_code))] pub fn allows_local_deployment(&self) -> bool { self.allow_local_deployment } pub fn build_on_target(&self) -> bool { self.build_on_target }