Skip to content

Add try_exists function as wrapper over std::path::Path::try_exists#43

Open
kanpov wants to merge 1 commit intosmol-rs:masterfrom
kanpov:master
Open

Add try_exists function as wrapper over std::path::Path::try_exists#43
kanpov wants to merge 1 commit intosmol-rs:masterfrom
kanpov:master

Conversation

@kanpov
Copy link
Copy Markdown

@kanpov kanpov commented Dec 17, 2024

No description provided.

Signed-off-by: kanpov <karpovanton729@gmail.com>
@kanpov
Copy link
Copy Markdown
Author

kanpov commented Dec 17, 2024

@notgull ping

@kanpov
Copy link
Copy Markdown
Author

kanpov commented Dec 18, 2024

We can replicate behavior of the MSRV-incompatible std::fs::exists manually, but this approach is a simpler one that just uses std::path::Path::try_exists instead. This is what Tokio's tokio::fs::try_exists does, so I'd say it'd be a reasonable expectation for async_fs to mirror that functionality.

@taiki-e
Copy link
Copy Markdown
Collaborator

taiki-e commented Dec 18, 2024

Having try_* without the non-try_ variant sounds odd.

See also the stabilization report of std::fs::exists in rust-lang/rust#83186 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants