Move the URL and HTTP Client out of match block

I'm going to need these in several of the arms.
This commit is contained in:
2025-05-24 14:53:16 -05:00
parent 013c797e1f
commit f31f5b49da

View File

@@ -9,14 +9,14 @@ use reqwest::header::{ACCEPT, USER_AGENT};
async fn main() -> Result<(), Error> { async fn main() -> Result<(), Error> {
let args = Args::parse(); let args = Args::parse();
let request_url = format!(
"http://localhost:3000/api/v1/repos/{owner}/{repo}/releases",
owner = "robert",
repo = "rcalc",
);
let client = reqwest::Client::new();
match args.command { match args.command {
gt_tools::cli::Commands::ListReleases => { gt_tools::cli::Commands::ListReleases => {
let request_url = format!(
"http:/localhost:3000/api/v1/repos/{owner}/{repo}/releases",
owner = "robert",
repo = "rcalc",
);
let client = reqwest::Client::new();
let response = client let response = client
.get(request_url) .get(request_url)
.header(USER_AGENT, "gt-tools-test-agent") .header(USER_AGENT, "gt-tools-test-agent")