We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8c8bd7a commit 8a95a97Copy full SHA for 8a95a97
rocketmq-macros/src/request_header_custom.rs
@@ -55,12 +55,22 @@ pub(super) fn request_header_codec_inner(
55
const #static_name: &'static str = #camel_case_name;
56
},
57
(
58
- if has_option.is_some() {
59
- quote! {
+ if let Some(value) = has_option {
+ let type_name = get_type_name(value);
60
+ if type_name == "String" {
61
+ quote! {
62
+ if let Some(ref value) = self.#field_name {
63
+ map.insert (Self::#static_name.to_string(),value.to_string());
64
+ }
65
66
+ }else {
67
68
if let Some(value) = self.#field_name {
69
map.insert (Self::#static_name.to_string(),value.to_string());
70
}
71
72
73
+
74
} else {
75
quote! {
76
map.insert (Self::#static_name.to_string(),self.#field_name.to_string());
0 commit comments