refactor: ok_or_else()
-> ok_or_eyre()
This commit is contained in:
parent
fafa0bf689
commit
f4fa737124
10 changed files with 23 additions and 29 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue