Skip to content

Commit

Permalink
Merge pull request #27 from podusowski/remove-impl
Browse files Browse the repository at this point in the history
Remove impl
  • Loading branch information
podusowski authored Aug 5, 2023
2 parents 05fe230 + 55b32b8 commit 03a4c3e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/tiles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ impl Tiles {
#[derive(Debug, thiserror::Error)]
enum Error {
#[error(transparent)]
Http(#[from] reqwest::Error),
Http(reqwest::Error),

#[error("error while decoding the image: {0}")]
Image(String),
Expand All @@ -120,16 +120,16 @@ async fn download_single(client: &reqwest::Client, url: &str) -> Result<Tile, Er
.header(USER_AGENT, "Walkers")
.send()
.await
.map_err(Error::from)?;
.map_err(Error::Http)?;

log::debug!("Downloaded {:?}.", image.status());

let image = image
.error_for_status()
.map_err(Error::from)?
.map_err(Error::Http)?
.bytes()
.await
.map_err(Error::from)?;
.map_err(Error::Http)?;

Tile::from_image_bytes(&image).map_err(Error::Image)
}
Expand Down

0 comments on commit 03a4c3e

Please sign in to comment.