struct update syntax
Building a struct from another with ..other; unlisted fields are moved or copied from it.
In S { a: x, ..other }, every field not listed is taken from other by the normal move and copy rules.
Examples
let b = Book { pages: 500, ..a };takestitlefroma;a.pagesstill works, buta.titlehas moved and using it fails with E0382.
See also