Add reformat to the CI (#21)

This commit is contained in:
John Nunley 2022-12-22 12:35:18 -08:00 committed by GitHub
parent df091d59dd
commit 5674886dfa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 112 additions and 78 deletions

View file

@ -7,13 +7,16 @@ use winit::window::WindowBuilder;
fn main() {
//see fruit.jpg.license for the license of fruit.jpg
let fruit = image::load_from_memory(include_bytes!("fruit.jpg")).unwrap();
let buffer = fruit.pixels().map(|(_x, _y, pixel)|{
let red = pixel.0[0] as u32;
let green = pixel.0[1] as u32;
let blue = pixel.0[2] as u32;
let buffer = fruit
.pixels()
.map(|(_x, _y, pixel)| {
let red = pixel.0[0] as u32;
let green = pixel.0[1] as u32;
let blue = pixel.0[2] as u32;
blue | (green << 8) | (red << 16)
}).collect::<Vec<_>>();
blue | (green << 8) | (red << 16)
})
.collect::<Vec<_>>();
let event_loop = EventLoop::new();
let window = WindowBuilder::new()