(&self)
| 441 | /// ``` |
| 442 | #[must_use] |
| 443 | pub fn parent(&self) -> Option<&Path> { |
| 444 | let mut comps = self.components(); |
| 445 | let comp = comps.next_back(); |
| 446 | comp.and_then(|p| match p { |
| 447 | Component::Normal(_) | Component::CurDir | Component::ParentDir => { |
| 448 | Some(comps.as_path()) |
| 449 | } |
| 450 | _ => None, |
| 451 | }) |
| 452 | } |
| 453 | |
| 454 | /// Returns the final component of the `Path`, if there is one. |
| 455 | /// |
no test coverage detected