Do not abuse PathBuf::push("") for appending directory separator#4
Do not abuse PathBuf::push("") for appending directory separator#4seanyoung wants to merge 1 commit into
Conversation
Since rust-lang/rust#89270 rust's pathbuf push() normalizes the path if it is a verbatim path, so that the result is still a valid verbatim path. This involves parsing reconstructing the path. Appending a path separator using push("") will no longer work, and if it did, it would be very inefficient. rust-lang/rust#89658 Signed-off-by: Sean Young <sean@mess.org>
|
Thank you for the fix, but unfortunately, this will not work in all cases. Pushing
Unfortunately, this actually is the most efficient implementation currently. This crate is very careful to avoid converting rust-lang/89665 should fix this issue, so I will close this for now. However, given that rust-lang/89270 was accepted, it may be useful to make other fixes from this crate in the standard library as well when I have time. |
I considered that, but colons are no allowed in files/directories so I did not think this is an issue. |
|
That's true, but I think This has been temporarily fixed in version 0.3.1. |
Since rust-lang/rust#89270 rust's pathbuf
push() normalizes the path if it is a verbatim path, so that the result
is still a valid verbatim path. This involves parsing reconstructing the
path.
Appending a path separator using push("") will no longer work, and if
it did, it would be very inefficient.
rust-lang/rust#89658
Signed-off-by: Sean Young sean@mess.org