-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for
[#default]
and setting field-level durability
- Loading branch information
1 parent
0cae5c5
commit 7aa6e9d
Showing
12 changed files
with
238 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/// Generate either `field_ref_expr` or `field_ty::default` | ||
/// | ||
/// Used when generating an input's builder. | ||
#[macro_export] | ||
macro_rules! maybe_default { | ||
( | ||
($maybe_clone:ident, $maybe_backdate:ident, default), | ||
$field_ty:ty, | ||
$field_ref_expr:expr, | ||
) => { | ||
<$field_ty>::default() | ||
}; | ||
|
||
( | ||
($maybe_clone:ident, $maybe_backdate:ident, required), | ||
$field_ty:ty, | ||
$field_ref_expr:expr, | ||
) => { | ||
$field_ref_expr | ||
}; | ||
} | ||
|
||
#[macro_export] | ||
macro_rules! maybe_default_tt { | ||
(($maybe_clone:ident, $maybe_backdate:ident, default) => $($t:tt)*) => { | ||
$($t)* | ||
}; | ||
|
||
(($maybe_clone:ident, $maybe_backdate:ident, required) => $($t:tt)*) => { | ||
|
||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.