From 0788aaaedba0043861955189834b9f5a31e22a47 Mon Sep 17 00:00:00 2001 From: Felix Wittwer Date: Mon, 22 Aug 2022 00:34:24 +0200 Subject: [PATCH] Set new icons for Codeberg and Gitea (#165) --- src/models/repo.rs | 4 ++-- src/server/views/html/status.rs | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/models/repo.rs b/src/models/repo.rs index 5c22e1a..98fc6c5 100644 --- a/src/models/repo.rs +++ b/src/models/repo.rs @@ -42,7 +42,7 @@ impl fmt::Display for RepoPath { write!( f, "{} => {}/{}", - self.site.to_string(), + self.site, self.qual.as_ref(), self.name.as_ref() ) @@ -96,7 +96,7 @@ impl FromStr for RepoSite { type Err = Error; fn from_str(input: &str) -> Result { - if let Some((site, domain)) = input.split_once("/") { + if let Some((site, domain)) = input.split_once('/') { match site { "gitea" => Ok(RepoSite::Gitea(domain.parse()?)), _ => Err(anyhow!("unknown repo site identifier")), diff --git a/src/server/views/html/status.rs b/src/server/views/html/status.rs index 9df8225..8504842 100644 --- a/src/server/views/html/status.rs +++ b/src/server/views/html/status.rs @@ -127,11 +127,11 @@ fn get_site_icon(site: &RepoSite) -> (FaType, &'static str) { RepoSite::Github => (FaType::Brands, "github"), RepoSite::Gitlab => (FaType::Brands, "gitlab"), RepoSite::Bitbucket => (FaType::Brands, "bitbucket"), - // FIXME: There is no brands/{sourcehut, codeberg, gitea} icon, so just use a - // regular circle which looks close enough. - RepoSite::Sourcehut | RepoSite::Codeberg | RepoSite::Gitea(_) => { - (FaType::Regular, "circle") - } + // FIXME: There is no brands/{sourcehut, codeberg, gitea} icon, so just use an + // icon which looks close enough. + RepoSite::Sourcehut => (FaType::Regular, "circle"), + RepoSite::Codeberg => (FaType::Solid, "mountain"), + RepoSite::Gitea(_) => (FaType::Brands, "git-alt"), } }