about summary refs log tree commit diff
path: root/library/std/src/path
AgeCommit message (Collapse)AuthorLines
2021-10-01path.push() should work as expected on windows verbatim pathsSean Young-0/+9
2021-08-22Auto merge of #85166 - mbhall88:file-prefix, r=dtolnaybors-87/+310
add file_prefix method to std::path This is an initial implementation of `std::path::Path::file_prefix`. It is effectively a "left" variant of the existing [`file_stem`](https://doc.rust-lang.org/std/path/struct.Path.html#method.file_stem) method. An illustration of the difference is ```rust use std::path::Path; let path = Path::new("foo.tar.gz"); assert_eq!(path.file_stem(), Some("foo.tar")); assert_eq!(path.file_prefix(), Some("foo")); ``` In my own development, I generally find I almost always want the prefix, rather than the stem, so I thought it might be best to suggest it's addition to libstd. Of course, as this is my first contribution, I expect there is probably more work that needs to be done. Additionally, if the libstd team feel this isn't appropriate then so be it. There has been some [discussion about this on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/219381-t-libs/topic/file_lstem/near/238076313) and a user there suggested I open a PR to see whether someone in the libstd team thinks it is worth pursuing.
2021-08-17remove unnecessary empty checkMichael Hall-0/+4
2021-07-06add Ord tests for Path comparisonsThe8472-0/+17
2021-07-06optimize {Path,PathBuf,Components}::{cmp,partial_cmp} for shared prefixesThe8472-0/+51
2021-06-15add explicit hidden file name testsMichael Hall-0/+26
2021-05-11add missing windows testsMichael Hall-53/+140
2021-05-11add file_prefix methodMichael Hall-34/+140
2020-11-07Refactor `parse_prefix` on WindowsChristiaan Dirkx-4/+4
Refactor `get_first_two_components` to `get_next_component`. Fixes the following behaviour of `parse_prefix`: - series of separator bytes in a prefix are correctly parsed as a single separator - device namespace prefixes correctly recognize both `\\` and `/` as separators
2020-08-31std: move "mod tests/benches" to separate filesLzu Tao-0/+1394
Also doing fmt inplace as requested.