Replace `Init` with `const Default` or something else
yvt opened this issue · 0 comments
yvt commented
Having a local trait Init
is problematic for a number of reasons:
Init
is implemented on some external types, such asArrayVec
andTokenLock
, for internal use. However,Init
is also exposed to the user to allow for its use withr3::hunk::Hunk
, giving access to these internal-use-only trait implementations. This means removing these trait implementations is a breaking change.- Implementing
Init
in an external crate requires a dependency onr3
even if the rest ofr3
is not needed at all.
The best course of action is to replace Init
with something else provided by an upstream crate or a language feature.