Fix clippy error

This commit is contained in:
Benoît du Garreau 2022-05-28 23:58:47 +02:00
parent f36e74e383
commit 6431c5567c

View File

@ -191,7 +191,7 @@ impl TakeScreenshot {
format, format,
)), )),
} }
.and_then(|pixel_bytes| { .map(|pixel_bytes| {
let image = image::ImageBuffer::<image::Rgba<u8>, Vec<u8>>::from_vec( let image = image::ImageBuffer::<image::Rgba<u8>, Vec<u8>>::from_vec(
self.width, self.width,
self.height, self.height,
@ -200,7 +200,7 @@ impl TakeScreenshot {
.expect( .expect(
"Failed to create ImageBuffer! Buffer was not large enough. This should not occur", "Failed to create ImageBuffer! Buffer was not large enough. This should not occur",
); );
Ok(image::DynamicImage::ImageRgba8(image)) image::DynamicImage::ImageRgba8(image)
}); });
// Call supplied handler // Call supplied handler