Skip to content

Commit

Permalink
chore: const for github.com string
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexD10S committed Apr 26, 2024
1 parent 5a515f9 commit 8e97eb1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crates/pop-parachains/src/utils/git.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Vec<Release>> {
static APP_USER_AGENT: &str =
concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION"));
Expand Down Expand Up @@ -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..])
}
}

Expand Down

0 comments on commit 8e97eb1

Please sign in to comment.