use crate::prelude::*;
impl SegmentedPath<'_> {
pub fn pop(&mut self) -> Result<bool, SetPathError> {
match self {
Self::File (x) => x.pop() ,
Self::SpecialNotFile(x) => x.pop() ,
Self::NonSpecial (x) => Ok(x.pop()),
}
}
pub fn pop_if_empty(&mut self) -> Result<bool, SetPathError> {
match self {
Self::File (x) => x.pop_if_empty() ,
Self::SpecialNotFile(x) => x.pop_if_empty() ,
Self::NonSpecial (x) => Ok(x.pop_if_empty()),
}
}
pub fn remove(&mut self, index: isize) -> Result<bool, SetPathError> {
match self {
Self::File (x) => x.remove(index) ,
Self::SpecialNotFile(x) => x.remove(index) ,
Self::NonSpecial (x) => Ok(x.remove(index)),
}
}
}