| Age | Commit message (Collapse) | Author | Lines |
|
|
|
More links, one more occurrence of “a OsString”
Co-authored-by: Yuki Okushi <huyuumi.dev@gmail.com>
|
|
|
|
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)
|
|
This adds the ID of the tracking issue to the feature.
|
|
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]
|
|
|
|
|
|
|
|
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]
|
|
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.
|
|
|
|
Now that #76934 has merged, we can remove a lot of these! E.g, this is
no longer necessary:
[`Vec<T>`]: Vec
|
|
|
|
|
|
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.
|
|
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.
|
|
Also doing fmt inplace as requested.
|
|
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
|
|
|
|
|
|
Add additional case for Path starts with
Show what happens if there is an extra extension
|
|
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
|
|
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`]
|
|
Remove ambiguity from PathBuf pop example
|
|
Use assert! for Path exists example to check bool
|
|
Show Path extension example change multi extension
|
|
Separate example for Path strip_prefix
|
|
Show relative example for Path ancestors
|
|
|
|
|
|
|
|
|
|
Show what happens if there is an extra extension
|
|
|
|
|
|
|
|
We faced a footgun when using ends_with to check extension,
showing an example could prevent that.
|
|
|