From a4e781d4e40580622baf2b4a901c7f619ceb274a Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Mon, 8 Apr 2024 08:22:23 +0100 Subject: [PATCH] feat(config): make RepoDetails Clone --- src/server/config.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/server/config.rs b/src/server/config.rs index bc2fb58..a7baccd 100644 --- a/src/server/config.rs +++ b/src/server/config.rs @@ -87,25 +87,28 @@ impl Display for Repo { write!(f, "{} - {}", self.repo, self.branch) } } -#[derive(Clone)] +#[derive(Clone, Debug, PartialEq, Eq)] pub struct ForgeName(pub String); impl Display for ForgeName { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { write!(f, "{}", self.0) } } +#[derive(Clone, Debug, PartialEq, Eq)] pub struct Hostname(pub String); impl Display for Hostname { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { write!(f, "{}", self.0) } } +#[derive(Clone, Debug, PartialEq, Eq)] pub struct User(pub String); impl Display for User { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { write!(f, "{}", self.0) } } +#[derive(Clone, Debug, PartialEq, Eq)] pub struct ForgeDetails { pub name: ForgeName, pub forge_type: ForgeType, @@ -124,25 +127,28 @@ impl From<(&ForgeName, &Forge)> for ForgeDetails { } } } -#[derive(Clone)] +#[derive(Clone, Debug, PartialEq, Eq)] pub struct RepoName(pub String); impl Display for RepoName { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { write!(f, "{}", self.0) } } +#[derive(Clone, Debug, PartialEq, Eq)] pub struct RepoPath(pub String); impl Display for RepoPath { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { write!(f, "{}", self.0) } } +#[derive(Clone, Debug, PartialEq, Eq)] pub struct BranchName(pub String); impl Display for BranchName { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { write!(f, "{}", self.0) } } +#[derive(Clone, Debug, PartialEq, Eq)] pub struct RepoDetails { pub name: RepoName, pub repo: RepoPath,