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. /// This function is safe to be called repeatedly.
pub fn magick_wand_terminus() { pub fn magick_wand_terminus() {
unsafe { unsafe {
match bindings::IsMagickWandInstantiated() { if let bindings::MagickBooleanType_MagickTrue = bindings::IsMagickWandInstantiated() {
bindings::MagickBooleanType_MagickTrue => bindings::MagickWandTerminus(), bindings::MagickWandTerminus();
_ => (),
} }
} }
} }

View File

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