feat(config): impl Display for RepoDetails
All checks were successful
ci/woodpecker/push/docker Pipeline was successful
ci/woodpecker/push/todo-check Pipeline was successful
ci/woodpecker/push/release Pipeline was successful
ci/woodpecker/push/build Pipeline was successful

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 {
type Result = ();
fn handle(&mut self, _msg: StartRepo, _ctx: &mut Self::Context) -> Self::Result {
info!(
"Starting Repo: {} - {}",
self.details.name.0, self.details.repo.0
);
info!(%self.details, "Starting Repo");
}
}

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)]
pub enum ForgeType {