(&mut self, path: &Path)
| 203 | } |
| 204 | |
| 205 | fn _push(&mut self, path: &Path) { |
| 206 | // in general, a separator is needed if the rightmost byte is not a separator |
| 207 | let need_sep = self.as_mut_vec().last().map(|c| !is_sep_byte(*c)).unwrap_or(false); |
| 208 | |
| 209 | // absolute `path` replaces `self` |
| 210 | if path.is_absolute() { |
| 211 | self.as_mut_vec().truncate(0); |
| 212 | // `path` is a pure relative path |
| 213 | } else if !path.has_root() && need_sep { |
| 214 | self.inner.push(MAIN_SEP_STR); |
| 215 | } |
| 216 | |
| 217 | self.inner.push(path); |
| 218 | } |
| 219 | |
| 220 | /// Truncates `self` to [`self.parent`]. |
| 221 | /// |
no test coverage detected