Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit cfb8021

Browse files
committedJun 25, 2024
rust-lang#126333 remove PathBuf::as_mut_vec reference at top of PathBuf::_push
1 parent a451b2a commit cfb8021

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎std/src/path.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1290,7 +1290,8 @@ impl PathBuf {
12901290

12911291
fn _push(&mut self, path: &Path) {
12921292
// in general, a separator is needed if the rightmost byte is not a separator
1293-
let mut need_sep = self.as_mut_vec().last().map(|c| !is_sep_byte(*c)).unwrap_or(false);
1293+
let buf = self.inner.as_encoded_bytes();
1294+
let mut need_sep = buf.last().map(|c| !is_sep_byte(*c)).unwrap_or(false);
12941295

12951296
// in the special case of `C:` on Windows, do *not* add a separator
12961297
let comps = self.components();

0 commit comments

Comments
 (0)
Failed to load comments.