Skip to content

Commit

Permalink
Reformat verbose error handling code
Browse files Browse the repository at this point in the history
  • Loading branch information
lovasoa committed Aug 12, 2019
1 parent f7798d9 commit 1a05161
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ impl Arguments {
name: self.dezoomer.clone(),
})
}
fn best_size<I: Iterator<Item=Vec2d>>(&self, sizes: I) -> Option<Vec2d> {
fn best_size<I: Iterator<Item = Vec2d>>(&self, sizes: I) -> Option<Vec2d> {
if self.largest {
sizes.max_by_key(|s| s.x * s.y)
} else if self.max_width.is_some() || self.max_height.is_some() {
Expand Down Expand Up @@ -349,21 +349,15 @@ impl Canvas {
if success {
Ok(())
} else {
let Vec2d {
x: twidth,
y: theight,
} = tile.size();
let Vec2d {
x: width,
y: height,
} = self.size();
let tile_size = tile.size();
let size = self.size();
Err(ZoomError::TileCopyError {
x,
y,
twidth,
theight,
width,
height,
twidth: tile_size.x,
theight: tile_size.y,
width: size.x,
height: size.y,
})
}
}
Expand Down

0 comments on commit 1a05161

Please sign in to comment.