refactor: ok_or_else() -> ok_or_eyre()

This commit is contained in:
seth 2024-01-27 23:33:00 -05:00
parent fafa0bf689
commit f4fa737124
No known key found for this signature in database
GPG key ID: D31BD0D494BBEE86
10 changed files with 23 additions and 29 deletions

View file

@ -21,13 +21,13 @@ pub async fn get(id: Option<u64>) -> Result<Response> {
let req = REQWEST_CLIENT
.get(format!("{RORY}{ENDPOINT}/{target}"))
.build()
.wrap_err_with(|| "Couldn't build reqwest client!")?;
.wrap_err("Couldn't build reqwest client!")?;
debug!("Making request to {}", req.url());
let resp = REQWEST_CLIENT
.execute(req)
.await
.wrap_err_with(|| "Couldn't make request for rory!")?;
.wrap_err("Couldn't make request for rory!")?;
let status = resp.status();
@ -35,7 +35,7 @@ pub async fn get(id: Option<u64>) -> Result<Response> {
let data = resp
.json::<Response>()
.await
.wrap_err_with(|| "Couldn't parse the rory response!")?;
.wrap_err("Couldn't parse the rory response!")?;
Ok(data)
} else {