Use $crate prepend to make importing the _clap_count_exprs macro unnecessary

This commit is contained in:
Erich Gubler 2018-12-18 16:02:27 -07:00 committed by Kevin K
parent e798fec73b
commit ab65a0200d
No known key found for this signature in database
GPG key ID: 17218E4B3692F01A

View file

@ -264,7 +264,7 @@ macro_rules! values_t_or_exit {
macro_rules! _clap_count_exprs {
() => { 0 };
($e:expr) => { 1 };
($e:expr, $($es:expr),+) => { 1 + _clap_count_exprs!($($es),*) };
($e:expr, $($es:expr),+) => { 1 + $crate::_clap_count_exprs!($($es),*) };
}
/// Convenience macro to generate more complete enums with variants to be used as a type when
@ -348,7 +348,7 @@ macro_rules! arg_enum {
}
impl $e {
#[allow(dead_code)]
pub fn variants() -> [&'static str; _clap_count_exprs!($(stringify!($v)),+)] {
pub fn variants() -> [&'static str; $crate::_clap_count_exprs!($(stringify!($v)),+)] {
[
$(stringify!($v),)+
]