From 843ed71a689ad8a12a1a6e407a1f33723193b1c5 Mon Sep 17 00:00:00 2001 From: Jasper Bryant-Greene Date: Sun, 28 Jul 2019 09:14:06 +0100 Subject: [PATCH] Updated to *image* v0.22.0 --- Cargo.toml | 4 ++-- src/lib.rs | 8 ++++---- src/render/image.rs | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 63a66f3..0f42551 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,11 +20,11 @@ is-it-maintained-open-issues = { repository = "kennytm/qrcode-rust" } maintenance = { status = "passively-maintained" } [dependencies] -image = { version = "0.21", default-features = false, optional = true } +image = { version = "0.22", default-features = false, optional = true } checked_int_cast = "1" [dev-dependencies] -image = "0.21" +image = "0.22" [features] default = ["image", "svg"] diff --git a/src/lib.rs b/src/lib.rs index 04cecf0..f50bd22 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -232,8 +232,8 @@ impl QrCode { /// /// let image = QrCode::new(b"hello").unwrap() /// .render() - /// .dark_color(Rgb { data: [0, 0, 128] }) - /// .light_color(Rgb { data: [224, 224, 224] }) // adjust colors + /// .dark_color(Rgb([0, 0, 128])) + /// .light_color(Rgb([224, 224, 224])) // adjust colors /// .quiet_zone(false) // disable quiet zone (white border) /// .min_dimensions(300, 300) // sets minimum image size /// .build(); @@ -336,8 +336,8 @@ mod image_tests { let image = code .render() .min_dimensions(200, 200) - .dark_color(Rgb { data: [128, 0, 0] }) - .light_color(Rgb { data: [255, 255, 128] }) + .dark_color(Rgb([128, 0, 0])) + .light_color(Rgb([255, 255, 128])) .build(); let expected = load_from_memory(include_bytes!("test_annex_i_micro_qr_as_image.png")).unwrap().to_rgb(); assert_eq!(image.dimensions(), expected.dimensions()); diff --git a/src/render/image.rs b/src/render/image.rs index 4ee59ea..31d6a41 100644 --- a/src/render/image.rs +++ b/src/render/image.rs @@ -13,7 +13,7 @@ macro_rules! impl_pixel_for_image_pixel { fn default_color(color: Color) -> Self { match color.select($s::zero(), $s::max_value()) { - $c => $p { data: $d }, + $c => $p($d), } } }