From 8e97eb1cfd9f48d2cef6545751efc0aa2bd22c5a Mon Sep 17 00:00:00 2001 From: AlexD10S Date: Fri, 26 Apr 2024 15:14:55 +0200 Subject: [PATCH] chore: const for github.com string --- crates/pop-parachains/src/utils/git.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/pop-parachains/src/utils/git.rs b/crates/pop-parachains/src/utils/git.rs index 83b9c8f7..1cfd13d3 100644 --- a/crates/pop-parachains/src/utils/git.rs +++ b/crates/pop-parachains/src/utils/git.rs @@ -144,6 +144,7 @@ impl Git { pub struct GitHub; impl GitHub { + const GITHUB: &'static str = "github.com"; pub async fn get_latest_releases(repo: &Url) -> Result> { static APP_USER_AGENT: &str = concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION")); @@ -219,7 +220,7 @@ impl GitHub { format!("{}/releases/download/{tag}/{artifact}", repo.as_str()) } pub(crate) fn convert_to_shh_url(url: &Url) -> String { - format!("git@{}:{}.git", url.host_str().unwrap_or("github.com"), &url.path()[1..]) + format!("git@{}:{}.git", url.host_str().unwrap_or(Self::GITHUB), &url.path()[1..]) } }