-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Either::as_ref method #31
Comments
Yes, inherent methods take priority over trait methods.
Renaming would be a breaking change, at least, requiring us to bump to
You can see in #12 when But |
Thanks for such a detailed answer! :) As you've mentioned To make my long story short, do you agree that it's not a good thing that Btw, nice trick with the Anyhow, thanks again for the explanation! |
I think it's an unfortunate clash, but not that big of a deal. It still works for trait bounds, and you can call it directly in the UFCS style, however ugly that may be. 🙂 I think it's not helpful to make deprecations and replacements until we're actually planning a 2.0, then we can do it to ease the transition. Until then, it wouldn't help the current conflict, so the deprecation would just add more noise. |
Well, sounds reasonable, but then another question appears: do you think it's worth adding a milestone or a tag or something for a probable 2.0? I have a bad feeling that all the improvement ideas might easily get lost in time, and if I close this issue (since it's more-or-less resolved) at least I will definitely forget about it after some time.. |
I don't know that 2.0 is "probable" any time soon, but I just added a "potential-2.0" label, at least. :) |
Hi everyone,
I've just hit an issue while trying to replace an
impl AsRef
with a concreteEither
type in a return position, here's an example: https://play.rust-lang.org/?gist=1f4771605ae47ea7e4e10881a994a2dc&version=stable&mode=debug&edition=2015I believe it happens because
Either::as_ref
method effectively hides theAsRef::as_ref
method :(Shouldn't it be renamed to something like
to_ref
so it doesn't overlap with theAsRef
trait, or is there any reason behind this specific name? The same goes foras_mut
and probably forinto_iter
as well.The text was updated successfully, but these errors were encountered: