#126333 remove PathBuf::as_mut_vec reference at top of PathBuf::_push

This commit is contained in:
ash 2024-06-22 18:53:31 -06:00
parent c2d2bb38c9
commit 2155c6c477

View File

@ -1290,7 +1290,8 @@ pub fn push<P: AsRef<Path>>(&mut self, path: P) {
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();