Closed
Description
C-COMMON-TRAITS wants me to impl Default
. The first example in C-CTOR is fn new() -> Example<T>
.
It would be nice to have a convention around when a new
constructor with no parameters makes sense, when we should just use Default::default
, and when new
should actually use default
(or some other variations).
Previous discussions about this:
- new idiom: Default trait rust-unofficial/patterns#48
- https://deterministic.space/elegant-apis-in-rust.html#fn:new
- killercup/scribbles@c5863eb#commitcomment-19523203
- killercup/scribbles@628f531#commitcomment-19527945
cc @llogiq