Improve AddrParseError documentation.#48853
Conversation
|
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @joshtriplett (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
|
I like the premise of this change, adding information about what can cause an error. However, there's a certain tone this documentation takes that I'd rather we avoid. In particular, "rustc isn't angry anymore" seems problematic. Also, "because of wrong resource typing" doesn't quite make sense. "because the provided string does not parse as the given type, often because it includes information only handled by a different address type", perhaps? |
Yes, I'll replace that with a more neutral sentence. edit:
I'm fine with that too. That's more exhaustive. |
|
The changes were applied. Thanks! |
src/libstd/net/parser.rs
Outdated
There was a problem hiding this comment.
Nit: "has disappeared" rather than "has disappear". Also, need a "the" before the panic!.
Looks good otherwise, thanks for the update!
src/libstd/net/parser.rs
Outdated
There was a problem hiding this comment.
"information" is invariable. "pieces of information"
src/libstd/net/parser.rs
Outdated
There was a problem hiding this comment.
Please add an empty line.
There was a problem hiding this comment.
Done. I hope that's what you wanted. I didn't know if it was for line 389 or 390.
There was a problem hiding this comment.
No, it's the correct place. :)
|
If that's ok for you, that should be ok for me too. :) |
|
It's time to squash. |
a1f0565 to
0931715
Compare
|
Done! |
src/libstd/net/parser.rs
Outdated
There was a problem hiding this comment.
Sorry, forgot to ask you to turn this into an url (like done in a few places here too).
There was a problem hiding this comment.
The current page we are reading is the AddrParseError page. It seemed useless to me, but, ok, I'll apply the changes.
There was a problem hiding this comment.
Ah then my bad. Just ignore this comment.
There was a problem hiding this comment.
Too fast, I had applied the changes. :)
src/libstd/net/parser.rs
Outdated
src/libstd/net/parser.rs
Outdated
There was a problem hiding this comment.
We should never use unwrap in examples (or in code more generally). At worst, please use expect.
src/libstd/net/parser.rs
Outdated
src/libstd/net/parser.rs
Outdated
There was a problem hiding this comment.
Just like you said, it's useless to do this since we're already on the correct page (sorry again about this...).
There was a problem hiding this comment.
Hi,
Yes, it was removed. See 11be095203a084733966e9d52b1c0489bbd22056.
Add a potential cause to `AddrParseError` raising.
11be095 to
5e991e1
Compare
|
Thanks! @bors: r+ rollup |
|
📌 Commit 5e991e1 has been approved by |
…ion_improvement, r=GuillaumeGomez Improve `AddrParseError` documentation. I've added potential cause to `AddrParseError` raising.
I've added potential cause to
AddrParseErrorraising.