Skip to content

Commit

Permalink
Fix struct optional non-optional field
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavo-shigueo committed Nov 10, 2024
1 parent 1a13390 commit 0aa63ea
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions macros/src/types/named.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,17 @@ fn format_field(
Optional {
optional: false, ..
},
)
| (
) => match extract_option_argument(&parsed_ty) {
Ok(inner_type) => {
if nullable {
(&parsed_ty, "?")
} else {
(inner_type, "?")
}
}
Err(_) => (&parsed_ty, ""),
},
(
_,
Optional {
optional: true,
Expand Down

0 comments on commit 0aa63ea

Please sign in to comment.