mirror of https://github.com/rwf2/Rocket.git
333da45470
If stars aligned properly, we might imagine writing this: #[non_exhaustive] struct Config { pub field: Foo, pub other: Bar, } ...with semantics that would allow the defining crate (here, Rocket), to construct the structure directly while consumers would need to use public constructors or struct update syntax: Config { field: Foo, other: Bar, ..Default::default() } Alas, this is not the way `non_exhaustive` works on structs. You cannot use field-update syntax to construct `Config` above. You must use public constructors. This means builder methods or mutating an already built struct. This is not what we want. I don't know why it works this way. I don't see why it must. Something something Drop. So we have this hack from the pre-non_exhaustive era. |
||
---|---|---|
.. | ||
fuzz | ||
src | ||
tests | ||
Cargo.toml | ||
build.rs |