Skip to content

Convention around fn new() vs. impl Default #38

Closed
@killercup

Description

@killercup

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:

cc @llogiq

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions