feat(config): add GitDir type

This commit is contained in:
Paul Campbell 2024-04-21 18:38:47 +01:00
parent e10561f853
commit 56e253b545

View file

@ -392,5 +392,24 @@ impl Display for ForgeType {
} }
} }
#[derive(Debug, Clone, PartialEq, Eq, Deserialize)]
pub struct GitDir(PathBuf);
impl GitDir {
#[allow(dead_code)] // TODO:
pub const fn pathbuf(&self) -> &PathBuf {
&self.0
}
}
impl std::fmt::Display for GitDir {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
write!(f, "{self:?}")
}
}
impl From<&str> for GitDir {
fn from(value: &str) -> Self {
Self(value.into())
}
}
#[cfg(test)] #[cfg(test)]
mod tests; mod tests;