Format code using 'cargo fmt'

This commit is contained in:
Atul Bhosale 2019-08-17 21:48:01 +05:30
parent 65ae47fbf8
commit f286c631b9
No known key found for this signature in database
GPG key ID: 9CE70EE4DDBEB4A7
3 changed files with 13 additions and 11 deletions

View file

@ -152,7 +152,8 @@ fn find_image_magick_include_dirs() -> Vec<PathBuf> {
.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<PathBuf, env::VarError> {

View file

@ -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

View file

@ -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]);
}
}