forked from kemitix/git-next
feat(config): impl Display for RepoDetails
This commit is contained in:
parent
e9685abf5f
commit
77705035f9
2 changed files with 16 additions and 4 deletions
|
@ -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
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
Loading…
Reference in a new issue