From f286c631b92325613a38b439ae2a12674665dc33 Mon Sep 17 00:00:00 2001 From: Atul Bhosale Date: Sat, 17 Aug 2019 21:48:01 +0530 Subject: [PATCH] Format code using 'cargo fmt' --- build.rs | 3 ++- src/wand/macros.rs | 4 +++- tests/lib.rs | 17 ++++++++--------- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/build.rs b/build.rs index 5798819..1e28793 100644 --- a/build.rs +++ b/build.rs @@ -152,7 +152,8 @@ fn find_image_magick_include_dirs() -> Vec { .or_else(|_| Ok(vec![find_image_magick_dir()?.join("include")])) .or_else(|_: env::VarError| -> Result<_, env::VarError> { Ok(run_pkg_config().include_paths) - }).expect("Couldn't find ImageMagick include directory") + }) + .expect("Couldn't find ImageMagick include directory") } fn find_image_magick_dir() -> Result { diff --git a/src/wand/macros.rs b/src/wand/macros.rs index c1c17b5..eff0d2b 100644 --- a/src/wand/macros.rs +++ b/src/wand/macros.rs @@ -44,7 +44,9 @@ macro_rules! wand_common { unsafe { ::bindings::$get_exc_type(self.wand) } } - pub fn get_exception(&self) -> Result<(String, ::bindings::ExceptionType), &'static str> { + pub fn get_exception( + &self, + ) -> Result<(String, ::bindings::ExceptionType), &'static str> { let mut severity: ::bindings::ExceptionType = ::bindings::ExceptionType_UndefinedException; // TODO: memory management diff --git a/tests/lib.rs b/tests/lib.rs index 89a7991..6541daf 100644 --- a/tests/lib.rs +++ b/tests/lib.rs @@ -234,10 +234,9 @@ fn test_transform_image_colorspace() { let pixel_color = wand.get_image_pixel_color(10, 10).unwrap(); assert_ne!(pixel_color.get_hsl().hue, 0.0); - assert!( - wand.transform_image_colorspace(bindings::ColorspaceType_GRAYColorspace) - .is_ok() - ); + assert!(wand + .transform_image_colorspace(bindings::ColorspaceType_GRAYColorspace) + .is_ok()); assert_eq!( wand.get_image_colorspace(), bindings::ColorspaceType_GRAYColorspace @@ -266,15 +265,15 @@ fn test_color_reduction() { let image_colors = wand.get_image_colors(); assert!(image_colors > 38000 || image_colors < 40000); - assert!( - wand.quantize_image( + assert!(wand + .quantize_image( 6, bindings::ColorspaceType_RGBColorspace, 1, bindings::DitherMethod_UndefinedDitherMethod, false.to_magick() - ).is_ok() - ); + ) + .is_ok()); assert_eq!(6, wand.get_image_colors()); let histogram = wand.get_image_histogram().unwrap(); @@ -319,4 +318,4 @@ fn test_set_background_color() { assert_eq!(0u8, blob[1]); assert_eq!(0u8, blob[2]); assert_eq!(0u8, blob[3]); -} \ No newline at end of file +}