From 294beff930a0d6b7c08205afc7efc2b2e0998cd5 Mon Sep 17 00:00:00 2001 From: Andreas Steding Date: Wed, 10 Jun 2020 08:27:36 +0200 Subject: [PATCH] refactor: removed clap_count_exprs macro --- src/macros.rs | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/src/macros.rs b/src/macros.rs index af127c1d..3a4f3f5b 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -31,35 +31,6 @@ macro_rules! load_yaml { }; } -// _clap_count_exprs! is derived from https://github.com/DanielKeep/rust-grabbag -// commit: 82a35ca5d9a04c3b920622d542104e3310ee5b07 -// License: MIT -// Copyright ⓒ 2015 grabbag contributors. -// Licensed under the MIT license (see LICENSE or ) or the Apache License, Version 2.0 (see LICENSE of -// ), at your option. All -// files in the project carrying such notice may not be copied, modified, -// or distributed except according to those terms. -// -/// Counts the number of comma-delimited expressions passed to it. The result is a compile-time -/// evaluable expression, suitable for use as a static array size, or the value of a `const`. -/// -/// # Examples -/// -/// ``` -/// # #[macro_use] extern crate clap; -/// # fn main() { -/// const COUNT: usize = _clap_count_exprs!(a, 5+1, "hi there!".into_string()); -/// assert_eq!(COUNT, 3); -/// # } -/// ``` -#[macro_export] -macro_rules! _clap_count_exprs { - () => { 0 }; - ($e:expr) => { 1 }; - ($e:expr, $($es:expr),+) => { 1 + $crate::_clap_count_exprs!($($es),*) }; -} - /// Allows you to pull the version from your Cargo.toml at compile time as /// `MAJOR.MINOR.PATCH_PKGVERSION_PRE` ///