MCPcopy Create free account
hub / github.com/bendudson/EuraliOS / parent

Method parent

euralios_std/src/path.rs:443–452  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

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 ///

Callers 4

remove_fileFunction · 0.80
create_dirFunction · 0.80
popMethod · 0.80
path_parentFunction · 0.80

Calls 3

componentsMethod · 0.80
next_backMethod · 0.80
as_pathMethod · 0.80

Tested by

no test coverage detected