Fix the clippy warnings

cargo test passes
This commit is contained in:
Nathan Fiedler 2019-02-01 20:00:29 -08:00
parent 251df0167f
commit 07c4971b66
2 changed files with 12 additions and 11 deletions

View file

@ -61,9 +61,8 @@ pub fn magick_wand_genesis() {
/// This function is safe to be called repeatedly.
pub fn magick_wand_terminus() {
unsafe {
match bindings::IsMagickWandInstantiated() {
bindings::MagickBooleanType_MagickTrue => bindings::MagickWandTerminus(),
_ => (),
if let bindings::MagickBooleanType_MagickTrue = bindings::IsMagickWandInstantiated() {
bindings::MagickWandTerminus();
}
}
}

View file

@ -582,15 +582,17 @@ impl MagickWand {
width_ratio /= self.get_image_width() as f64;
let mut height_ratio = height as f64;
height_ratio /= self.get_image_height() as f64;
let new_width: size_t;
let new_height: size_t;
if width_ratio < height_ratio {
new_width = width;
new_height = (self.get_image_height() as f64 * width_ratio) as size_t;
let (new_width, new_height) = if width_ratio < height_ratio {
(
width,
(self.get_image_height() as f64 * width_ratio) as size_t,
)
} else {
new_width = (self.get_image_width() as f64 * height_ratio) as size_t;
new_height = height;
}
(
(self.get_image_width() as f64 * height_ratio) as size_t,
height,
)
};
unsafe {
bindings::MagickResetIterator(self.wand);
while bindings::MagickNextImage(self.wand) != bindings::MagickBooleanType_MagickFalse {