feat(config): impl Display for RepoDetails

This commit is contained in:
Paul Campbell 2024-04-08 08:12:31 +01:00
parent e9685abf5f
commit 77705035f9
2 changed files with 16 additions and 4 deletions

View file

@ -15,9 +15,6 @@ pub struct StartRepo;
impl Handler<StartRepo> for RepoActor { impl Handler<StartRepo> for RepoActor {
type Result = (); type Result = ();
fn handle(&mut self, _msg: StartRepo, _ctx: &mut Self::Context) -> Self::Result { fn handle(&mut self, _msg: StartRepo, _ctx: &mut Self::Context) -> Self::Result {
info!( info!(%self.details, "Starting Repo");
"Starting Repo: {} - {}",
self.details.name.0, self.details.repo.0
);
} }
} }

View file

@ -164,6 +164,21 @@ impl RepoDetails {
} }
} }
} }
impl Display for RepoDetails {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
write!(
f,
"{}/{} ({}): {}:{}/{} @ {}",
self.forge.name,
self.name,
self.forge.forge_type,
self.forge.hostname,
self.forge.user,
self.repo,
self.branch,
)
}
}
#[derive(Clone, Debug, PartialEq, Eq, Deserialize)] #[derive(Clone, Debug, PartialEq, Eq, Deserialize)]
pub enum ForgeType { pub enum ForgeType {