Provide and use macro for impl Derive via Builder
-
There were a lot of open-coded
impl Default ... FooBuilder::default().build()....
-
There were three cases where we
#[derive(Default)]
. As it happens none of these had non-Default
default fields, so there wasn't an actual bug.
Edited by Ian Jackson
Merge request reports
Activity
assigned to @Diziet
requested review from @eta
added 10 commits
-
ae07da4b...b137be22 - 8 commits from branch
tpo/core:main
- 3420fe73 - Define and use impl_default_via_builder
- 7909a51f - No longer derive Default on three structs which derive Builder
-
ae07da4b...b137be22 - 8 commits from branch
Rebased to:
- Make placement of the new macro calls consistent: always right after the FooConfig struct
- Add further call sites. I have now reviewed what I think are all the relevant places and I think they all use this macro now.
- Rename the macro. I plan to increase its functionality (including adding tests to it for properties that I discover are not currently true everywhere). Renaming it now will avoid having to touch most of the call sites.
mentioned in merge request !502 (merged)
mentioned in commit 7207b175
mentioned in merge request !505 (merged)
Please register or sign in to reply