From 9bedd978f3bc377ae518335723ae4e8f74e0c978 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?dj8yf0=CE=BCl?= Date: Mon, 10 Feb 2025 22:54:30 +0200 Subject: [PATCH] review: addresses https://github.com/near-cli-rs/interactive-clap/pull/26#discussion_r1946513458 --- .../interactive_clap/common_methods/choose_variant.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/interactive-clap-derive/src/derives/interactive_clap/common_methods/choose_variant.rs b/interactive-clap-derive/src/derives/interactive_clap/common_methods/choose_variant.rs index 974557f..d508ed3 100644 --- a/interactive-clap-derive/src/derives/interactive_clap/common_methods/choose_variant.rs +++ b/interactive-clap-derive/src/derives/interactive_clap/common_methods/choose_variant.rs @@ -35,8 +35,12 @@ pub fn fn_choose_variant( if attr.path.is_ident("strum_discriminants") { for attr_token in attr.tokens.clone() { if let proc_macro2::TokenTree::Group(group) = attr_token { - let group_stream_no_whitespace = - group.stream().to_string().replace(" ", ""); + let group_stream_no_whitespace = group + .stream() + .to_string() + .split_whitespace() + .collect::>() + .join(""); dbg_cond!(&group_stream_no_whitespace); if &group_stream_no_whitespace == "derive(EnumMessage,EnumIter)" { ast_attrs.push("strum_discriminants");