Apply suggested changes

This commit is contained in:
Ali Bektas 2024-04-18 16:28:32 +02:00 committed by Lukas Wirth
parent 29e5cdfb05
commit 23a5f31ff4
18 changed files with 1878 additions and 299 deletions

View file

@ -135,6 +135,24 @@ impl AbsPathBuf {
pub fn pop(&mut self) -> bool {
self.0.pop()
}
/// Equivalent of [`PathBuf::push`] for `AbsPathBuf`.
///
/// Extends `self` with `path`.
///
/// If `path` is absolute, it replaces the current path.
///
/// On Windows:
///
/// * if `path` has a root but no prefix (e.g., `\windows`), it
/// replaces everything except for the prefix (if any) of `self`.
/// * if `path` has a prefix but no root, it replaces `self`.
/// * if `self` has a verbatim prefix (e.g. `\\?\C:\windows`)
/// and `path` is not empty, the new path is normalized: all references
/// to `.` and `..` are removed.
pub fn push(&mut self, suffix: &str) {
self.0.push(suffix)
}
}
impl fmt::Display for AbsPathBuf {