4 ms·
> What if the initial values of the members are just constants In idiomatic rust impl Thing { fn new() -> Self { Thing { ival: 13, fva
by exDM69 7y ago
> What if the initial values of the members are just constants
In idiomatic rust
impl Thing {
fn new() -> Self {
Thing { ival: 13, fval: 42.0 }
}
Another option is to use Default::default if appropriate.