From 7308bcf8c0b9a38b93455f31b385cd235f19da92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Orhun=20Parmaks=C4=B1z?= Date: Tue, 19 Nov 2024 20:47:54 +0300 Subject: [PATCH] refactor(clippy): apply clippy suggestions --- git-cliff-core/src/embed.rs | 2 +- git-cliff-core/src/remote/bitbucket.rs | 4 ++-- git-cliff-core/src/remote/gitea.rs | 4 ++-- git-cliff-core/src/remote/github.rs | 4 ++-- git-cliff-core/src/remote/gitlab.rs | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/git-cliff-core/src/embed.rs b/git-cliff-core/src/embed.rs index 79450df..1d1ee03 100644 --- a/git-cliff-core/src/embed.rs +++ b/git-cliff-core/src/embed.rs @@ -47,7 +47,7 @@ impl BuiltinConfig { pub fn get_config(mut name: String) -> Result { if !Path::new(&name) .extension() - .map_or(false, |ext| ext.eq_ignore_ascii_case("toml")) + .is_some_and(|ext| ext.eq_ignore_ascii_case("toml")) { name = format!("{name}.toml"); } diff --git a/git-cliff-core/src/remote/bitbucket.rs b/git-cliff-core/src/remote/bitbucket.rs index d12e9d7..a25c747 100644 --- a/git-cliff-core/src/remote/bitbucket.rs +++ b/git-cliff-core/src/remote/bitbucket.rs @@ -180,8 +180,8 @@ impl TryFrom for BitbucketClient { } impl RemoteClient for BitbucketClient { - const API_URL: &str = "https://api.bitbucket.org/2.0/repositories"; - const API_URL_ENV: &str = "BITBUCKET_API_URL"; + const API_URL: &'static str = "https://api.bitbucket.org/2.0/repositories"; + const API_URL_ENV: &'static str = "BITBUCKET_API_URL"; fn remote(&self) -> Remote { self.remote.clone() diff --git a/git-cliff-core/src/remote/gitea.rs b/git-cliff-core/src/remote/gitea.rs index c7a6b09..1cb65d7 100644 --- a/git-cliff-core/src/remote/gitea.rs +++ b/git-cliff-core/src/remote/gitea.rs @@ -144,8 +144,8 @@ impl TryFrom for GiteaClient { } impl RemoteClient for GiteaClient { - const API_URL: &str = "https://codeberg.org"; - const API_URL_ENV: &str = "GITEA_API_URL"; + const API_URL: &'static str = "https://codeberg.org"; + const API_URL_ENV: &'static str = "GITEA_API_URL"; fn remote(&self) -> Remote { self.remote.clone() diff --git a/git-cliff-core/src/remote/github.rs b/git-cliff-core/src/remote/github.rs index 2548844..f69ef19 100644 --- a/git-cliff-core/src/remote/github.rs +++ b/git-cliff-core/src/remote/github.rs @@ -159,8 +159,8 @@ impl TryFrom for GitHubClient { } impl RemoteClient for GitHubClient { - const API_URL: &str = "https://api.github.com"; - const API_URL_ENV: &str = "GITHUB_API_URL"; + const API_URL: &'static str = "https://api.github.com"; + const API_URL_ENV: &'static str = "GITHUB_API_URL"; fn remote(&self) -> Remote { self.remote.clone() diff --git a/git-cliff-core/src/remote/gitlab.rs b/git-cliff-core/src/remote/gitlab.rs index 78c9bde..1e23870 100644 --- a/git-cliff-core/src/remote/gitlab.rs +++ b/git-cliff-core/src/remote/gitlab.rs @@ -241,8 +241,8 @@ impl TryFrom for GitLabClient { } impl RemoteClient for GitLabClient { - const API_URL: &str = "https://gitlab.com/api/v4"; - const API_URL_ENV: &str = "GITLAB_API_URL"; + const API_URL: &'static str = "https://gitlab.com/api/v4"; + const API_URL_ENV: &'static str = "GITLAB_API_URL"; fn remote(&self) -> Remote { self.remote.clone()