From db2208a33a49b767c596238398d10a35f33be5f3 Mon Sep 17 00:00:00 2001 From: Tobie Morgan Hitchcock Date: Sat, 23 Jul 2022 15:48:48 +0100 Subject: [PATCH] Store all macros in a separate module --- src/cli/version.rs | 6 ------ src/mac/mod.rs | 6 ++++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/cli/version.rs b/src/cli/version.rs index c3b3f1f3..cd13756d 100644 --- a/src/cli/version.rs +++ b/src/cli/version.rs @@ -2,12 +2,6 @@ use crate::cnf::PKG_NAME; use crate::cnf::PKG_VERS; use crate::err::Error; -macro_rules! get_cfg { - ($i:ident : $($s:expr),+) => ( - let $i = || { $( if cfg!($i=$s) { return $s; } );+ "unknown"}; - ) -} - pub fn init(_: &clap::ArgMatches) -> Result<(), Error> { get_cfg!(target_os: "windows", "macos", "ios", "linux", "android", "freebsd", "openbsd", "netbsd"); get_cfg!(target_arch: "x86", "x86_64", "mips", "powerpc", "powerpc64", "arm", "aarch64"); diff --git a/src/mac/mod.rs b/src/mac/mod.rs index 877f3b03..5e8204cb 100644 --- a/src/mac/mod.rs +++ b/src/mac/mod.rs @@ -13,3 +13,9 @@ macro_rules! mrg { $($m)+ }}; } + +macro_rules! get_cfg { + ($i:ident : $($s:expr),+) => ( + let $i = || { $( if cfg!($i=$s) { return $s; } );+ "unknown"}; + ) +}