Fix some pedantic lints

This commit is contained in:
Valentin Brandl
2023-06-13 10:22:37 +02:00
parent b07c732475
commit 361eacbe1d
8 changed files with 50 additions and 27 deletions

View File

@@ -29,7 +29,7 @@ pub(crate) trait Service: Sized + 'static {
}
#[derive(Deserialize, Serialize, Clone, Copy)]
pub enum FormService {
pub enum FormValue {
#[serde(rename = "github")]
GitHub,
#[serde(rename = "gitlab")]
@@ -40,22 +40,22 @@ pub enum FormService {
Sourcehut,
}
impl FormService {
impl FormValue {
pub(crate) fn url(&self) -> &str {
match self {
FormService::GitHub => "github.com",
FormService::Gitlab => "gitlab.com",
FormService::Bitbucket => "bitbucket.org",
FormService::Sourcehut => "git.sr.ht",
FormValue::GitHub => "github.com",
FormValue::Gitlab => "gitlab.com",
FormValue::Bitbucket => "bitbucket.org",
FormValue::Sourcehut => "git.sr.ht",
}
}
pub(crate) fn service(&self) -> &str {
match self {
FormService::GitHub => "github",
FormService::Gitlab => "gitlab",
FormService::Bitbucket => "bitbucket",
FormService::Sourcehut => "sourcehut",
FormValue::GitHub => "github",
FormValue::Gitlab => "gitlab",
FormValue::Bitbucket => "bitbucket",
FormValue::Sourcehut => "sourcehut",
}
}
}