Closed ma2bd closed 3 years ago
This is safe because values of a type Array<T> where T is not af::HasEnum cannot be produced by a user anyway.
Array<T>
T
af::HasEnum
Pros: this trick allows library users to make their own struct definitions "lightweight" as well (as suggested by the Rust API guidelines).
Cons: the bound has to be removed from the Drop implementation as well (which is fine but perhaps counter intuitive)
This is safe because values of a type
Array<T>
whereT
is notaf::HasEnum
cannot be produced by a user anyway.Pros: this trick allows library users to make their own struct definitions "lightweight" as well (as suggested by the Rust API guidelines).
Cons: the bound has to be removed from the Drop implementation as well (which is fine but perhaps counter intuitive)