What about a Take
trait?
#61148
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.
I saw issue #61129, and thought that it might be a good idea to generalize it.
The prelude could export a new trait called
Take
.A lot of types could implement it,
Vec<T>
for example. Thetake
method onOption<T>
could be moved into this trait, etc.The
Take
trait could even be implemented for every type that implementsDefault
:The text was updated successfully, but these errors were encountered: