Skip to content
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

fn prefix mentioned on std::path::Path documentation #34076

Closed
ghost opened this issue Jun 4, 2016 · 9 comments
Closed

fn prefix mentioned on std::path::Path documentation #34076

ghost opened this issue Jun 4, 2016 · 9 comments
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-help-wanted Call for participation: Help is requested to fix this issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.

Comments

@ghost
Copy link

ghost commented Jun 4, 2016

Link: https://doc.rust-lang.org/std/path/struct.Path.html

One example:
"On Windows, a path is absolute if it has a prefix and starts with the root: c:\windows is absolute, while c:temp and \temp are not. In other words, path.is_absolute() == path.prefix().is_some() && path.has_root()."

This should be reworded to avoid using prefix(), which has since been removed.

@steveklabnik steveklabnik added E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. E-help-wanted Call for participation: Help is requested to fix this issue. labels Jun 27, 2016
@steveklabnik
Copy link
Member

I would be happy to work with anyone who wants to fix this issue.

@pwlandoll
Copy link
Contributor

@steveklabnik I'm new to Rust, but I could take on this one. I've been looking and I can't seem to find a drop-in substitute for path.prefix(). Is there a way that I'm not seeing to determine the prefix of a path?

Would it be better to just remove the whole "In other words..." sentence? I think the first half of that bullet point could be enough to convey the idea. Other than that instance, I don't see anywhere else in the documentation that references prefix().

Thanks!

@steveklabnik
Copy link
Member

@pwlandoll great! So, it does look like prefix was just removed entirely: #27722

So yes, I would think the "in other words" part being removed would solve the issue 👍

@pwlandoll
Copy link
Contributor

Cool. I found two other instances of the .prefix() being used in the src/libstd/path.rs file, though both functions seem to have been marked as deprecated. Should these be removed as well?

@steveklabnik
Copy link
Member

Don't worry about it; they are actually calling this

@pwlandoll
Copy link
Contributor

Great, that works. So for this, what would I do before the pull request? Just a make check or can I do make check-stage1-std NO_REBUILD=1?

@steveklabnik
Copy link
Member

Frankly, just removing a non-example line of the documentation shouldn't affect tests at all, so I wouldn't even bother running it.

@pwlandoll
Copy link
Contributor

Guess I can never be too sure. Pull request it is!

bors added a commit that referenced this issue Jul 4, 2016
Issue #34076: Removing reference to removed path.prefix() function

In the documentation for `std::path::Path`, there is a [reference](https://doc.rust-lang.org/std/path/struct.Path.html#method.is_absolute) to the `path.prefix()` function which has since been removed. The offending reference is now also removed.

First pull request, feedback welcome!

r? @steveklabnik
@GuillaumeGomez
Copy link
Member

I think this issue has been solved by @pwlandoll's PR. If not, don't hesitate to say it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-help-wanted Call for participation: Help is requested to fix this issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.
Projects
None yet
Development

No branches or pull requests

3 participants