-
Notifications
You must be signed in to change notification settings - Fork 13.3k
std::path::Path::starts_with documentation unclear #24882
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
Comments
Huh. This is very strange. @alexcrichton do you have any insight here? |
Yes this is because everything's based around the iterators which need to be consumes exhaustively for matches like this to return true. I have also been bitten by this in the past though! cc @aturon |
The way I look at it is that the path API works with parsed, normalized paths, which consist of a number of components (between path separators). The entire API surface works this way. So I would rather add a |
@aturon I think a |
I agree with @aturon, the current behavior of |
Several Minor API / Reference Documentation Fixes - Fix a few small errors in the reference. - Fix paper cuts in the API docs. Fixes rust-lang#24882 Fixes rust-lang#25233 Fixes rust-lang#25250
Several Minor API / Reference Documentation Fixes - Fix a few small errors in the reference. - Fix paper cuts in the API docs. Fixes rust-lang#24882 Fixes rust-lang#25233 Fixes rust-lang#25250
The current documentation for
std::path::Path::starts_with
does not specify that it uses components asbase
. For example as described in the current documentation I expected to be able to use characters asbase
to find hidden files/directories as such:As described in the documentation I expected
is_dot(&PathBuf::from(rel_path))
to be evaluated as true when it does notThe text was updated successfully, but these errors were encountered: