-
Notifications
You must be signed in to change notification settings - Fork 1.6k
RFC: Deprecate FromStr in favor of TryFrom<&str> #2924
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
Conversation
I updated the RFC to be backward compatible (this is still a work in progress). |
I am strongly opposed to deprecating I'd also rather we didn't deprecate I don't really see a lot of value in deprecating this stuff. This RFC is very light on details. |
I am appreciative of the strangeness between |
There has been some discussion about this here. About the lack of details: I will add content. I just need some time to put my thoughts into writings. |
You may wish to re-read https://github.com/rust-lang/rfcs#before-creating-an-rfc |
I strongly feel that A few things that influence my feelings:
Honestly, I feel that the churn is very overstated. Deprecation exists for cases like this where a very clear alternative is there, and this is an example. That said, I do agree that the RFC itself could do much better to elaborate on all of these points. |
To clarify: I think your enthusiasm in writing this RFC is wonderful, although I think that if you don't know a whole lot about the process it's much better to communicate with folks before submitting an RFC, and I know a lot of people would likely be willing to help you out. The definition of breaking changes is probably one of the biggest things to know when it comes to writing an RFC and I'd say that you definitely want to read up on that first. I believe that there's actually an RFC for it, but as I'm on my phone I don't have the time to look up which one it is. |
Thanks for your opinion, this RFC was clearly prematurely created. My apologies. I've posted a topic for further discussion. |
As a somewhat-new Rust user I experienced considerable confusion trying to figure out why both FromStr and TryFrom<&str> existed. I spent several hours banging my head against the wall trying to figure out why the standard library had a FromStr trait! I thought to myself: surely the Rust designers, having created such an amazing language, would not have included a superflous trait like this for no reason. There must be some secret super-power posessed by FromStr that I am not aware of. I must learn this secret super-power! To my dismay, FromStr has no such secret super-powers. And I cannot recover the half-afternoon spent searching for them :( I realize that deprecating FromStr and parse() will lead to lots of churn for experienced Rustaceans. But please realize that leaving them in the standard library for the rest of eternity will instead create much confusion for newcomers. Many, many more newcomers will waste half an afternoon like I did. Perhaps this is worse than current library maintainers each having to waste a day or two updating their code? Rust is still quite new and growing fast; there are certainly many more future users between now and the end of time than there are library maintainers in the year 2021. In the meantime, please consider adding text to the docs explaining FromStr's historical provenance, its overlap with TryFrom<&str>, and the reason why FromStr still exists. This was the first place I went looking for an answer to "why does FromStr exist when we have TryFrom<&str>?". I hope this comment is not perceived as unconstructive. Just wanted to provide some perspective from a new user. |
Adding docs to |
If anyone wishes to take over this RFC draft, be my guest. |
Honestly considering it. Not sure if I'll have a chance to give it a shot before the weekend. |
If I understand, for that to be possible, we'd need to cover all currently covered Getting that coverage could be done in parallel with this RFC, and would bring Am I correct? |
FYI, as noted here some crates implements |
Rendered
This is a work in progress.