about summary refs log tree commit diff
path: root/library/std/src/path.rs
AgeCommit message (Collapse)AuthorLines
2021-04-27Override `clone_from` method for PathBuf and OsStringBenoît du Garreau-1/+13
2021-03-31Apply suggestions from code reviewFrank Steffahn-2/+2
More links, one more occurrence of “a OsString” Co-authored-by: Yuki Okushi <huyuumi.dev@gmail.com>
2021-03-31Add a few missing links, fix a typoFrank Steffahn-7/+7
2021-03-16Rollup merge of #81822 - Kixunil:path_try_exists, r=kennytmYuki Okushi-0/+30
Added `try_exists()` method to `std::path::Path` This method is similar to the existing `exists()` method, except it doesn't silently ignore the errors, leading to less error-prone code. This change intentionally does NOT touch the documentation of `exists()` nor recommend people to use this method while it's unstable. Such changes are reserved for stabilization to prevent confusing people. Apart from that it avoids conflicts with #80979. `@joshtriplett` requested this PR in [internals discussion](https://internals.rust-lang.org/t/the-api-of-path-exists-encourages-broken-code/13817/25?u=kixunil)
2021-03-16Filled tracking issue for path_try_existsMartin Habovstiak-1/+1
This adds the ID of the tracking issue to the feature.
2021-02-23Rollup merge of #82128 - anall:feature/add_diagnostic_items, r=davidtwcoDylan DPC-0/+2
add diagnostic items for OsString/PathBuf/Owned as well as to_vec on slice This is adding diagnostic items to be used by rust-lang/rust-clippy#6730, but my understanding is the clippy-side change does need to be done over there since I am adding a new clippy feature. Add diagnostic items to the following types: OsString (os_string_type) PathBuf (path_buf_type) Owned (to_owned_trait) As well as the to_vec method on slice/[T]
2021-02-16Add caveat to Path::display() about lossinessManish Goregaokar-2/+6
2021-02-16a few more diagnostic itemsAndrea Nall-0/+1
2021-02-15requested/proposed changesAndrea Nall-1/+1
2021-02-15add diagnostic itemsAndrea Nall-0/+1
Add diagnostic items to the following types: OsString (os_string_type) PathBuf (path_buf_type) Owned (to_owned_trait) As well as the to_vec method on slice/[T]
2021-02-06Added `try_exists()` method to `std::path::Path`Martin Habovstiak-0/+30
This method is similar to the existing `exists()` method, except it doesn't silently ignore the errors, leading to less error-prone code. This change intentionally does NOT touch the documentation of `exists()` nor recommend people to use this method while it's unstable. Such changes are reserved for stabilization to prevent confusing people. Apart from that it avoids conflicts with #80979.
2021-01-22Inline methods of Path and OsStringBenoît du Garreau-0/+69
2020-12-31Remove many unnecessary manual link resolves from libraryCamelid-1/+0
Now that #76934 has merged, we can remove a lot of these! E.g, this is no longer necessary: [`Vec<T>`]: Vec
2020-10-27Clean up intra-doc links in `std::path`Camelid-6/+5
2020-10-12Use intra-doc links for links to module-level docsCamelid-2/+2
2020-09-30Fix is_absolute on WASIIngvar Stepanyan-1/+1
WASI does not match `cfg(unix)`, but its paths are Unix-like (`/some/path`) and don't have Windows-like prefixes. Without this change, `is_absolute` for paths like `/some/path` was returning `false`on a WASI target, which is obviously not true and undesirable.
2020-09-19Rollup merge of #73963 - hellow554:unsafe_path, r=Mark-SimulacrumRalf Jung-19/+18
deny(unsafe_op_in_unsafe_fn) in libstd/path.rs The libstd/path.rs part of #73904 . Wraps the two calls to an unsafe fn Initializer::nop() in an unsafe block.
2020-08-31std: move "mod tests/benches" to separate filesLzu Tao-1400/+3
Also doing fmt inplace as requested.
2020-08-15Auto merge of #75246 - pickfire:patch-5, r=Amanieubors-2/+7
Add more examples to Path ends_with We faced a footgun when using ends_with to check extension, showing an example could prevent that. https://github.com/rust-dc/fish-manpage-completions/pull/106/commits/2c155e50b2d9e607174908b3f80f1dcf92693eee
2020-08-15Use resolve.conf as example for Path ends_withIvan Tham-6/+6
2020-08-11deny(unsafe_op_in_unsafe_fn) in libstd/path.rsMarcel Hellwig-20/+19
2020-08-10Rollup merge of #75286 - pickfire:patch-9, r=jyn514Yuki Okushi-1/+5
Add additional case for Path starts with Show what happens if there is an extra extension
2020-08-10show multiple slashes starts_with Path exampleIvan Tham-1/+2
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2020-08-09Auto merge of #75293 - poliorcetics:intra-doc-links-std-path, r=jyn514bors-151/+45
Move to intra-doc links in library/std/src/path.rs Helps with #75080. @rustbot modify labels: T-doc, A-intra-doc-links, T-rustdoc Known issue: The following links are broken (they are inside trait impls, undocumented in this file, inheriting from the original doc): - [`Hasher`] - [`Self`] (referencing `../primitive.slice.html`) - [`Ordering`]
2020-08-09Rollup merge of #75289 - pickfire:patch-12, r=jonas-schievinkYuki Okushi-2/+2
Remove ambiguity from PathBuf pop example
2020-08-09Rollup merge of #75288 - pickfire:patch-11, r=jonas-schievinkYuki Okushi-1/+1
Use assert! for Path exists example to check bool
2020-08-09Rollup merge of #75287 - pickfire:patch-10, r=jonas-schievinkYuki Okushi-0/+2
Show Path extension example change multi extension
2020-08-09Rollup merge of #75285 - pickfire:patch-8, r=jonas-schievinkYuki Okushi-2/+3
Separate example for Path strip_prefix
2020-08-09Rollup merge of #75284 - pickfire:patch-7, r=LukasKalbertodtYuki Okushi-0/+7
Show relative example for Path ancestors
2020-08-08Move to intra-doc links in library/std/src/path.rsAlexis Bourget-151/+45
2020-08-08Remove abmiguity from PathBuf pop exampleIvan Tham-2/+2
2020-08-08Use assert! for Path exists example to check boolIvan Tham-1/+1
2020-08-08Show Path extension example change multi extensionIvan Tham-0/+2
2020-08-08Add additonal case for Path starts withIvan Tham-1/+4
Show what happens if there is an extra extension
2020-08-08Separate example for Path strip_prefixIvan Tham-2/+3
2020-08-08Show relative example for Path ancestorsIvan Tham-0/+7
2020-08-08Show multi extension example for Path in doctestsIvan Tham-6/+4
2020-08-07Add more examples to Path ends_withIvan Tham-0/+5
We faced a footgun when using ends_with to check extension, showing an example could prevent that.
2020-07-27mv std libs to library/mark-0/+4230