From abbd2e66e6c8143cdeac4e5094f6f0e6a4ebce5a Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Mon, 8 Apr 2024 09:55:40 +0100 Subject: [PATCH] feat(actors/repo): add RepoActor::new --- src/server/actors/repo.rs | 7 ++++++- src/server/mod.rs | 9 ++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/server/actors/repo.rs b/src/server/actors/repo.rs index 27e54162..2f2f9468 100644 --- a/src/server/actors/repo.rs +++ b/src/server/actors/repo.rs @@ -4,7 +4,12 @@ use tracing::info; use crate::server::config::RepoDetails; pub struct RepoActor { - pub details: RepoDetails, + details: RepoDetails, +} +impl RepoActor { + pub(crate) const fn new(details: RepoDetails) -> Self { + Self { details } + } } impl Actor for RepoActor { type Context = Context; diff --git a/src/server/mod.rs b/src/server/mod.rs index fbd1fb87..ddd894c9 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -57,9 +57,12 @@ pub fn start(fs: FileSystem) { let span = tracing::info_span!("Repo", %repo_name, %repo); let _guard = span.enter(); info!("Creating Repo"); - let actor = actors::repo::RepoActor { - details: config::RepoDetails::new(&repo_name, repo, &forge_name, forge), - }; + let actor = actors::repo::RepoActor::new(config::RepoDetails::new( + &repo_name, + repo, + &forge_name, + forge, + )); actors.push((forge_name.clone(), repo_name, actor)); info!("Created Repo"); });