use std::{fmt::Display, path::Path};
pub(crate) enum PathComponents<'a> {
Path(&'a Path),
Component(&'a PathComponents<'a>, &'a Path),
}
impl<'p> Display for PathComponents<'p> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
PathComponents::Path(p) => p.display().fmt(f),
PathComponents::Component(p, c) => {
p.fmt(f)?;
f.write_str("/")?;
c.display().fmt(f)
}
}
}
}