Rollup merge of #126140 - eduardosm:stabilize-fs_try_exists, r=Amanieu
Rename `std::fs::try_exists` to `std::fs::exists` and stabilize fs_try_exists FCP completed in tracking issue. Tracking issue: https://github.com/rust-lang/rust/issues/83186 Closes https://github.com/rust-lang/rust/issues/83186 Stabilized API: ```rust mod fs { pub fn exists<P: AsRef<Path>>(path: P) -> io::Result<bool>; } ```
This commit is contained in:
commit
f3ced9d540
10 changed files with 18 additions and 19 deletions
|
@ -2907,6 +2907,8 @@ impl Path {
|
|||
/// prevent time-of-check to time-of-use (TOCTOU) bugs. You should only use it in scenarios
|
||||
/// where those bugs are not an issue.
|
||||
///
|
||||
/// This is an alias for [`std::fs::exists`](crate::fs::exists).
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
|
@ -2919,7 +2921,7 @@ impl Path {
|
|||
#[stable(feature = "path_try_exists", since = "1.63.0")]
|
||||
#[inline]
|
||||
pub fn try_exists(&self) -> io::Result<bool> {
|
||||
fs::try_exists(self)
|
||||
fs::exists(self)
|
||||
}
|
||||
|
||||
/// Returns `true` if the path exists on disk and is pointing at a regular file.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue