mirror of
https://github.com/rust-lang/rust
synced 2024-10-14 20:46:49 +00:00
#126333 remove PathBuf::as_mut_vec
reference at top of PathBuf::_push
This commit is contained in:
parent
c2d2bb38c9
commit
2155c6c477
|
@ -1290,7 +1290,8 @@ pub fn push<P: AsRef<Path>>(&mut self, path: P) {
|
||||||
|
|
||||||
fn _push(&mut self, path: &Path) {
|
fn _push(&mut self, path: &Path) {
|
||||||
// in general, a separator is needed if the rightmost byte is not a separator
|
// 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
|
// in the special case of `C:` on Windows, do *not* add a separator
|
||||||
let comps = self.components();
|
let comps = self.components();
|
||||||
|
|
Loading…
Reference in a new issue