mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-06-16 23:56:37 +00:00
Rename ReleaseArtifactUrl
to GhReleaseArtifactUrl
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
81bdc3ba6e
commit
3cee8a927b
1 changed files with 4 additions and 4 deletions
|
@ -229,7 +229,7 @@ impl GhApiClient {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Eq, PartialEq, Hash)]
|
#[derive(Clone, Debug, Eq, PartialEq, Hash)]
|
||||||
pub struct ReleaseArtifactUrl(Url);
|
pub struct GhReleaseArtifactUrl(Url);
|
||||||
|
|
||||||
impl GhApiClient {
|
impl GhApiClient {
|
||||||
/// Return `Ok(Some(api_artifact_url))` if exists.
|
/// Return `Ok(Some(api_artifact_url))` if exists.
|
||||||
|
@ -241,7 +241,7 @@ impl GhApiClient {
|
||||||
release,
|
release,
|
||||||
artifact_name,
|
artifact_name,
|
||||||
}: GhReleaseArtifact,
|
}: GhReleaseArtifact,
|
||||||
) -> Result<Option<ReleaseArtifactUrl>, GhApiError> {
|
) -> Result<Option<GhReleaseArtifactUrl>, GhApiError> {
|
||||||
let once_cell = self.0.release_artifacts.get(release.clone());
|
let once_cell = self.0.release_artifacts.get(release.clone());
|
||||||
let res = once_cell
|
let res = once_cell
|
||||||
.get_or_try_init(|| {
|
.get_or_try_init(|| {
|
||||||
|
@ -265,7 +265,7 @@ impl GhApiClient {
|
||||||
match res {
|
match res {
|
||||||
Ok(Some(artifacts)) => Ok(artifacts
|
Ok(Some(artifacts)) => Ok(artifacts
|
||||||
.get_artifact_url(&artifact_name)
|
.get_artifact_url(&artifact_name)
|
||||||
.map(ReleaseArtifactUrl)),
|
.map(GhReleaseArtifactUrl)),
|
||||||
Ok(None) => Ok(None),
|
Ok(None) => Ok(None),
|
||||||
Err(GhApiError::RateLimit { retry_after }) => {
|
Err(GhApiError::RateLimit { retry_after }) => {
|
||||||
*self.0.retry_after.lock().unwrap() =
|
*self.0.retry_after.lock().unwrap() =
|
||||||
|
@ -279,7 +279,7 @@ impl GhApiClient {
|
||||||
|
|
||||||
pub async fn download_artifact(
|
pub async fn download_artifact(
|
||||||
&self,
|
&self,
|
||||||
artifact_url: ReleaseArtifactUrl,
|
artifact_url: GhReleaseArtifactUrl,
|
||||||
) -> Result<Download<'static>, GhApiError> {
|
) -> Result<Download<'static>, GhApiError> {
|
||||||
self.check_retry_after()?;
|
self.check_retry_after()?;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue