-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Improve std::path docs #41348
Improve std::path docs #41348
Conversation
Part of #29368. * added missing links * updated method summaries to use 3rd person style * added missing periods in `Component`'s variant summaries * use standard iterator boilerplate in `Components`' and `Iter`'s docs * added example to `Iter::as_path`, adapted from `Components::as_path`'s example * consolidated examples for `Path::file_name` * some other small fixes
Part of #29368. * Added a new summary paragraph about std::path's parsing facilities * Slightly exanded `Component`'s docs * removed the now redundant section on component types from the module docs * moved the section on path normalization during parsing to the docs on `Path::components` * Clarified difference between `Prefix` and `PrefixComponent` in their respecive summary sentences
Part of #29368. * Added explanation for why the struct exists * Added link to where it is created * Added example
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the changes here are great @lukaramu, awesome work! Just a couple small nits and this should be good to go 👌
/// | ||
/// Note that no other normalization takes place; in particular, `a/c` | ||
/// and `a/b/../c` are distinct, to account for the possibility that `b` | ||
/// is a symbolic link (so its parent isn't `a`). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call, I think it makes sense to have this normalization section here
/// performed. | ||
/// Windows uses a variety of path prefix styles, including references to drive | ||
/// volumes (like `C:`), network shared folders (like `\\server\share`), and | ||
/// others. In addition, some path prefixes are "verbatim" (i.e. prefixed with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This parenthesis is never closed
src/libstd/path.rs
Outdated
/// The root directory component, appears after any prefix and before anything else | ||
/// The root directory component, appears after any prefix and before anything else. | ||
/// | ||
/// It represents a deperator that designates that a path starts from root. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deperator
-> seperator
* Closed an unclosed paren * seperator -> separator * deperator -> separator
Comments have been addressed, fixed another typo along the way, too! 😅 |
Thanks again! @bors r+ rollup |
📌 Commit d6f7577 has been approved by |
Improve std::path docs Fixes rust-lang#29368. This PR contains a pretty significant redistribution of some of the module docs to more appropriate places, as well as general expansion, clarification, and additional examples. For more details, see the commit descriptions. r? @steveklabnik
Improve std::path docs Fixes rust-lang#29368. This PR contains a pretty significant redistribution of some of the module docs to more appropriate places, as well as general expansion, clarification, and additional examples. For more details, see the commit descriptions. r? @steveklabnik
Improve std::path docs Fixes rust-lang#29368. This PR contains a pretty significant redistribution of some of the module docs to more appropriate places, as well as general expansion, clarification, and additional examples. For more details, see the commit descriptions. r? @steveklabnik
Improve std::path docs Fixes rust-lang#29368. This PR contains a pretty significant redistribution of some of the module docs to more appropriate places, as well as general expansion, clarification, and additional examples. For more details, see the commit descriptions. r? @steveklabnik
Improve std::path docs Fixes rust-lang#29368. This PR contains a pretty significant redistribution of some of the module docs to more appropriate places, as well as general expansion, clarification, and additional examples. For more details, see the commit descriptions. r? @steveklabnik
Improve std::path docs Fixes rust-lang#29368. This PR contains a pretty significant redistribution of some of the module docs to more appropriate places, as well as general expansion, clarification, and additional examples. For more details, see the commit descriptions. r? @steveklabnik
Improve std::path docs Fixes rust-lang#29368. This PR contains a pretty significant redistribution of some of the module docs to more appropriate places, as well as general expansion, clarification, and additional examples. For more details, see the commit descriptions. r? @steveklabnik
Fixes #29368.
This PR contains a pretty significant redistribution of some of the module docs to more appropriate places, as well as general expansion, clarification, and additional examples.
For more details, see the commit descriptions.
r? @steveklabnik