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)
| 620 | /// assert_eq!(root_file.parent_path(), ""); |
| 621 | /// ``` |
| 622 | pub fn parent_path(&self) -> &str { |
| 623 | if let Some(idx) = self.path.rfind('/') { |
| 624 | &self.path[..idx] |
| 625 | } else { |
| 626 | "" |
| 627 | } |
| 628 | } |
| 629 | |
| 630 | /// Check if this item is hidden (filename starts with '.'). |
| 631 | /// |
no outgoing calls
no test coverage detected