]> git.lizzy.rs Git - rust.git/commit
Added `try_exists()` method to `std::path::Path`
authorMartin Habovstiak <martin.habovstiak@gmail.com>
Sat, 6 Feb 2021 12:16:37 +0000 (13:16 +0100)
committerMartin Habovstiak <martin.habovstiak@gmail.com>
Sat, 6 Feb 2021 21:16:54 +0000 (22:16 +0100)
commit66f7f7d8a9e6e524468f5d84e73b438274c20dbb
tree5a40ced7d98859d21e752101f44284c102a0c162
parent399b6452b5d9982438be208668bc758479f13725
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.
library/std/src/path.rs