Stabilize Path::try_exists()
and improve doc
This stabilizes the `Path::try_exists()` method which returns `Result<bool, io::Error>` instead of `bool` allowing handling of errors unrelated to the file not existing. (e.g permission errors) Along with the stabilization it also: * Warns that the `exists()` method is error-prone and suggests to use the newly stabilized one. * Suggests it instead of `metadata()` to handle errors. * Mentions TOCTOU bugs to avoid false assumption that `try_exists()` is completely safe fixed version of `exists()`. * Renames the feature of still-unstable `std::fs::try_exists()` to `fs_try_exists` to avoid name conflict. The tracking issue #83186 remains open to track `fs_try_exists`.
This commit is contained in:
parent
edab34ab2a
commit
56087074c6
3 changed files with 17 additions and 9 deletions
|
@ -1,6 +1,5 @@
|
|||
#![feature(let_chains)]
|
||||
#![feature(once_cell)]
|
||||
#![feature(path_try_exists)]
|
||||
#![feature(rustc_attrs)]
|
||||
#![feature(type_alias_impl_trait)]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue