PathBuf::set_extension accepts an extension containing slashes #32497
Labels
A-io
Area: `std::io`, `std::fs`, `std::net` and `std::path`
C-bug
Category: This is a bug.
T-libs-api
Relevant to the library API team, which will review and decide on the PR/issue.
The following code runs without any errors:
I'm not sure what I expected this to do. Maybe panic? I would also have been ok with short-circuiting and returning false. But succeeding feels weird to me.
The
set_file_name
method has a similar problem. There's no return value on that one, so panicking might be the only option, if we don't like allowing slashes in the new filename.The text was updated successfully, but these errors were encountered: