Free default()
function to augment Default::default()
#73000
Labels
C-feature-request
Category: A feature request, i.e: not implemented / a PR.
T-libs-api
Relevant to the library API team, which will review and decide on the PR/issue.
It feels a bit redundant to have to say
Default::default()
every time I need a new value of a type that has aDefault
instance.Especially so, compared to Haskell, where the same functionality is called
def
.Providing a free
default()
function that forwards toDefault::default()
seems to improve the situation.The trait is still there, so if someone wants to be explicit and to say
Default::default()
- it still works, but if imported asstd::default::default;
, then the free function reduces typing and visual noise.The text was updated successfully, but these errors were encountered: