Autoformat

This commit is contained in:
2025-07-03 17:30:56 -05:00
parent c9dda5760c
commit 84eaaa1dbd
5 changed files with 22 additions and 36 deletions

View File

@@ -1,9 +1,6 @@
use crate::{
Result,
structs::{
release::{CreateReleaseOption, Release},
},
structs::release::{CreateReleaseOption, Release},
};
pub fn get_release(_id: u64) -> Result<Release> {
@@ -59,7 +56,7 @@ pub async fn create_release(
return Ok(new_release);
} else if response.status().is_client_error() {
let mesg = crate::decode_client_error(response).await?;
return Err(crate::Error::ApiErrorMessage(mesg))
return Err(crate::Error::ApiErrorMessage(mesg));
}
panic!("Reached end of create_release without matching a return path");
}

View File

@@ -22,8 +22,10 @@ pub async fn create_release_attachment(
Ok(false) => return Err(crate::Error::NoSuchFile),
Err(e) => {
eprintln!("Uh oh! The file-exists check couldn't be done: {e}");
panic!("TODO: Deal with scenario where the file's existence cannot be checked (e.g.: no permission)");
},
panic!(
"TODO: Deal with scenario where the file's existence cannot be checked (e.g.: no permission)"
);
}
}
println!("Uploading file {}", &file);

View File

@@ -14,9 +14,7 @@ pub (crate) async fn decode_client_error(response: reqwest::Response) -> Result<
response
.json::<ApiError>()
.await
.map_err(|reqwest_err| {
crate::Error::WrappedReqwestErr(reqwest_err)
})
.map_err(|reqwest_err| crate::Error::WrappedReqwestErr(reqwest_err))
}
#[derive(Debug)]

View File

@@ -1,4 +1,3 @@
use std::path;
use gt_tool::cli::Args;
@@ -22,10 +21,7 @@ async fn main() -> Result<(), gt_tool::Error> {
headers.append("Authorization", token.parse().unwrap());
}
let client = reqwest::Client::builder()
.user_agent(format!(
"gt-tools-agent-{}",
env!("CARGO_PKG_VERSION")
))
.user_agent(format!("gt-tools-agent-{}", env!("CARGO_PKG_VERSION")))
.default_headers(headers)
.build()?;
@@ -37,11 +33,8 @@ async fn main() -> Result<(), gt_tool::Error> {
// user's command prompt. Otherwise the newest item scrolls off the
// screen and can't be seen.
itertools::Itertools::intersperse(
releases
.iter()
.rev()
.map(|release| release.colorized()),
String::from("")
releases.iter().rev().map(|release| release.colorized()),
String::from(""),
)
.map(|release| println!("{}", release))
.fold((), |_, _| ());
@@ -61,12 +54,7 @@ async fn main() -> Result<(), gt_tool::Error> {
tag_name,
target_commitish,
};
gt_tool::api::release::create_release(
&client,
&args.gitea_url,
&args.repo,
submission,
)
gt_tool::api::release::create_release(&client, &args.gitea_url, &args.repo, submission)
.await?;
}
gt_tool::cli::Commands::UploadRelease {
@@ -97,8 +85,10 @@ async fn main() -> Result<(), gt_tool::Error> {
Ok(false) => return Err(gt_tool::Error::NoSuchFile),
Err(e) => {
eprintln!("Uh oh! The file-exists check couldn't be done: {e}");
panic!("TODO: Deal with scenario where the file's existence cannot be checked (e.g.: no permission)");
},
panic!(
"TODO: Deal with scenario where the file's existence cannot be checked (e.g.: no permission)"
);
}
}
}
for file in files {

View File

@@ -1,4 +1,3 @@
use colored::Colorize;
use serde::{Deserialize, Serialize};