Get the parent directory path. # Returns The parent directory, or empty string if at root. # Example ```rust use atomic_core::output::repo::TreeItem; use atomic_core::types::{Inode, Position}; let item = TreeItem::file("src/lib/mod.rs", Inode::ROOT, Position::ROOT); assert_eq!(item.parent_path(), "src/lib"); let root_file = TreeItem::file("Cargo.toml", Inode::ROOT, Position::ROOT); assert_eq
(&self)
| 625 | /// assert_eq!(root_file.parent_path(), ""); |
| 626 | /// ``` |
| 627 | pub fn parent_path(&self) -> &str { |
| 628 | if let Some(idx) = self.path.rfind('/') { |
| 629 | &self.path[..idx] |
| 630 | } else { |
| 631 | "" |
| 632 | } |
| 633 | } |
| 634 | |
| 635 | /// Check if this item is hidden (filename starts with '.'). |
| 636 | /// |
no outgoing calls
no test coverage detected