Use State::default() directly, instead of per-member.

The example is sightly simplified that way, even though showing the
`..` notation for struct field initialization is probably a good thing
to do as well just for the learning experience.
This commit is contained in:
Sebastian Thiel 2015-08-23 12:36:01 +02:00
parent 793e4f9935
commit c70205501d

View File

@ -87,9 +87,7 @@ impl Default for AutoResizeState {
}
fn main() {
let mut state = State {
.. Default::default()
};
let mut state = State::default();
let mut support = Support::init();
let mut opened = true;