r3-os/r3

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 as ArrayVec and TokenLock, for internal use. However, Init is also exposed to the user to allow for its use with r3::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 on r3 even if the rest of r3 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.