test: Update API methods which are deprecated in image crate

This commit is contained in:
Shane Snover 2021-04-19 19:24:24 -06:00
parent 6f0eac5a8c
commit 82e158fcce

View file

@ -325,7 +325,7 @@ mod image_tests {
fn test_annex_i_qr_as_image() { fn test_annex_i_qr_as_image() {
let code = QrCode::new(b"01234567").unwrap(); let code = QrCode::new(b"01234567").unwrap();
let image = code.render::<Luma<u8>>().build(); let image = code.render::<Luma<u8>>().build();
let expected = load_from_memory(include_bytes!("test_annex_i_qr_as_image.png")).unwrap().to_luma(); let expected = load_from_memory(include_bytes!("test_annex_i_qr_as_image.png")).unwrap().to_luma8();
assert_eq!(image.dimensions(), expected.dimensions()); assert_eq!(image.dimensions(), expected.dimensions());
assert_eq!(image.into_raw(), expected.into_raw()); assert_eq!(image.into_raw(), expected.into_raw());
} }
@ -339,7 +339,7 @@ mod image_tests {
.dark_color(Rgb([128, 0, 0])) .dark_color(Rgb([128, 0, 0]))
.light_color(Rgb([255, 255, 128])) .light_color(Rgb([255, 255, 128]))
.build(); .build();
let expected = load_from_memory(include_bytes!("test_annex_i_micro_qr_as_image.png")).unwrap().to_rgb(); let expected = load_from_memory(include_bytes!("test_annex_i_micro_qr_as_image.png")).unwrap().to_rgb8();
assert_eq!(image.dimensions(), expected.dimensions()); assert_eq!(image.dimensions(), expected.dimensions());
assert_eq!(image.into_raw(), expected.into_raw()); assert_eq!(image.into_raw(), expected.into_raw());
} }