Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Why do you have the builder pattern (other than the verbosity of declaring them)?

I normally just leverage a couple of features: Derive(default) to have an "empty" initialized value and the struct field filling syntax

  let x = Foo { field_i_care_about, ..Default::default() };


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: