Skip to content

Commit

Permalink
rust-lang#126333 remove PathBuf::as_mut_vec reference at top of `Pa…
Browse files Browse the repository at this point in the history
…thBuf::_push`
  • Loading branch information
Borgerr committed Jun 23, 2024
1 parent 4333551 commit b6a3a24
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion library/std/src/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1290,7 +1290,8 @@ impl PathBuf {

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

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

0 comments on commit b6a3a24

Please sign in to comment.