summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCyborus <cyborus@noreply.codeberg.org>2023-12-17 04:50:31 +0100
committerCyborus <cyborus@noreply.codeberg.org>2023-12-17 04:50:31 +0100
commit3844a319e6dec8ffd162fd46fd6b972925aab0bb (patch)
treefbb19b42c2af384d9e4bd3f86c7da05e3fe24a39
parentMerge pull request 'update `forgejo-api` to version that uses rustls' (#14) f... (diff)
parentformat (diff)
downloadforgejo-cli-3844a319e6dec8ffd162fd46fd6b972925aab0bb.tar.xz
forgejo-cli-3844a319e6dec8ffd162fd46fd6b972925aab0bb.zip
Merge pull request 'format' (#15) from fmt into main
Reviewed-on: https://codeberg.org/Cyborus/forgejo-cli/pulls/15
-rw-r--r--src/release.rs15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/release.rs b/src/release.rs
index f2ed7f2..bbd1225 100644
--- a/src/release.rs
+++ b/src/release.rs
@@ -140,7 +140,7 @@ impl ReleaseCommand {
name,
} => create_asset(&repo, &api, release, path, name).await?,
AssetCommand::Delete { release, asset } => {
- delete_asset(&repo, &api, release, asset ).await?
+ delete_asset(&repo, &api, release, asset).await?
}
AssetCommand::Download {
release,
@@ -399,15 +399,22 @@ async fn download_asset(
) -> eyre::Result<()> {
let release = find_release(repo, api, &release).await?;
let file = match &*asset {
- "source.zip" => api.download_release_zip(repo.owner(), repo.name(), release.id).await?,
- "source.tar.gz" => api.download_release_tarball(repo.owner(), repo.name(), release.id).await?,
+ "source.zip" => {
+ api.download_release_zip(repo.owner(), repo.name(), release.id)
+ .await?
+ }
+ "source.tar.gz" => {
+ api.download_release_tarball(repo.owner(), repo.name(), release.id)
+ .await?
+ }
name => {
let asset = release
.assets
.iter()
.find(|a| a.name == name)
.ok_or_else(|| eyre!("asset not found"))?;
- api.download_release_attachment(repo.owner(), repo.name(), release.id, asset.id).await?
+ api.download_release_attachment(repo.owner(), repo.name(), release.id, asset.id)
+ .await?
}
};
let file = file.ok_or_else(|| eyre!("asset not found"))?;