Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#42955 - matklad:doc-path, r=steveklabnik
Document that `/` works as separator on Windows Hi Whenever I see code like `Path::new("./src/bin/main.rs")` or `path.ends_with("foo/bar")`, I wonder if it will work on Windows as I expect. Unfortunately, reading the current docs does not help to answer this question, because all examples are Unix-specific. However, I believe that using `/` is fine, because both Windows itself [and Rust stdlib](https://github.com/rust-lang/rust/blob/47faf1d51952ecd9d4c8a7325332fba34fbe00bd/src/libstd/sys/windows/path.rs#L26) do treat it as a file separator, and because it is [actually used](https://github.com/rust-lang/cargo/blob/abf01e1eddb3145c83f71b469ea7bee37141e5e1/tests/git.rs#L579) in Cargo. So looks like we can just document it? r? @steveklabnik cc @retep998 I don't actually program for windows that much, so I might be totally wrong, and perhaps we should advise to always use (allocating) `.join` method to construct paths of more than one component?
- Loading branch information