feat(config): add GitDir type
This commit is contained in:
parent
e10561f853
commit
56e253b545
1 changed files with 19 additions and 0 deletions
|
@ -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)]
|
||||
mod tests;
|
||||
|
|
Loading…
Reference in a new issue