feat: add "optional" flag for props

This commit is contained in:
Jonathan Kelley committed 2022-01-16 15:27:41 -05:00
1 parent 8e842231e4
commit 47bc4e4a44
2 files changed
+23 -1

No files matched your search

+8
View File
@@ -364,6 +364,14 @@ mod field_info {
Some(syn::parse(quote!(Default::default()).into()).unwrap());
Ok(())
}
"optional" => {
self.default =
Some(syn::parse(quote!(Default::default()).into()).unwrap());
self.strip_option = true;
Ok(())
}
_ => {
macro_rules! handle_fields {
( $( $flag:expr, $field:ident, $already:expr; )* ) => {