Skip to content

Commit

Permalink
Fix some warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
voidcontext committed Feb 4, 2025
1 parent aa9db76 commit e6b811d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/uri.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use serde::de::DeserializeOwned;
use serde::{Deserialize, Serialize};
use url::Url;

use crate::error::{Error, ScryfallError};
use crate::error::Error;
use crate::list::{List, ListIter};

/// An unresolved URI returned by the Scryfall API, or generated by this crate.
Expand Down Expand Up @@ -156,18 +156,18 @@ impl<T: DeserializeOwned> Uri<T> {
}
}

#[cfg(not(feature = "bulk_caching"))]
pub(crate) fn fetch_raw_blocking(&self) -> crate::Result<ureq::http::Response<ureq::Body>> {
// reqwest::blocking::get wouldn't work here as it would use it's own runtime, but ureq is
// blocking by default
match ureq::get(self.url.as_str().to_owned()).call() {
Ok(response) => match response.status().as_u16() {
400..=599 => {
let mut body = response.into_body();
Err(Error::ScryfallError(
Box::new(body
.read_json::<ScryfallError>()
.map_err(|e| Error::Other(e.to_string()))?),
))
Err(Error::ScryfallError(Box::new(
body.read_json::<crate::error::ScryfallError>()
.map_err(|e| Error::Other(e.to_string()))?,
)))
},
_ => Ok(response),
},
Expand Down

0 comments on commit e6b811d

Please sign in to comment.