-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should we really be implementing Deref
and DerefMut
#22
Comments
If we implement https://rust-lang.github.io/api-guidelines/predictability.html#c-smart-ptr |
After more thought I believe we are right to implement
ref: https://doc.rust-lang.org/std/ops/trait.Deref.html To remove the contradition with C-SMART-PTR I did #25 |
FWIW I agree, but if/when @Kixunil comes back I'll bet he complains about this. |
Aaand, now I'm going to complain! Just kidding! Actually, I think this is not abuse of Deref since it's not used to simulate OOP, it mostly obeys "a value of the type transparently behaves like a value of the target type" and there's a precedent for this in |
Ooh, interesting. And yes, the OO framing of "if the outer type can be substituted for the inner type with no changes then it's ok to |
The Rust API guidlines state that only smart pointers should implement these two traits but we are doing so. Is this correct?
links:
The text was updated successfully, but these errors were encountered: