diff --git a/interactive-clap-derive/src/derives/interactive_clap/methods/from_cli_for_struct.rs b/interactive-clap-derive/src/derives/interactive_clap/methods/from_cli_for_struct.rs index aaa8488..012a82f 100644 --- a/interactive-clap-derive/src/derives/interactive_clap/methods/from_cli_for_struct.rs +++ b/interactive-clap-derive/src/derives/interactive_clap/methods/from_cli_for_struct.rs @@ -99,13 +99,6 @@ fn fields_value(field: &syn::Field) -> proc_macro2::TokenStream { let ident_field = &field.clone().ident.expect("this field does not exist"); let fn_from_cli_arg = syn::Ident::new(&format!("from_cli_{}", &ident_field), Span::call_site()); if super::fields_without_subcommand::is_field_without_subcommand(field) { - let type_string = match &field.ty { - syn::Type::Path(type_path) => match type_path.path.segments.last() { - Some(path_segment) => path_segment.ident.to_string(), - _ => String::new(), - }, - _ => String::new(), - }; quote! { let #ident_field = Self::#fn_from_cli_arg( optional_clap_variant diff --git a/interactive-clap-derive/src/derives/interactive_clap/methods/interactive_clap_attrs_context.rs b/interactive-clap-derive/src/derives/interactive_clap/methods/interactive_clap_attrs_context.rs index c8c30cb..42d3dcf 100644 --- a/interactive-clap-derive/src/derives/interactive_clap/methods/interactive_clap_attrs_context.rs +++ b/interactive-clap-derive/src/derives/interactive_clap/methods/interactive_clap_attrs_context.rs @@ -43,22 +43,22 @@ impl InteractiveClapAttrsContext { }; } }; - let context_dir: Option = if let true = !context_dir.is_empty() { - Some(context_dir) - } else { + let context_dir: Option = if context_dir.is_empty() { None + } else { + Some(context_dir) }; let input_context_dir: Option = - if let true = !input_context_dir.is_empty() { - Some(input_context_dir) - } else { + if input_context_dir.is_empty() { None + } else { + Some(input_context_dir) }; let output_context_dir: Option = - if let true = !output_context_dir.is_empty() { - Some(output_context_dir) - } else { + if output_context_dir.is_empty() { None + } else { + Some(output_context_dir) }; Self { context_dir,