diff --git a/benches/affine_transformations.rs b/benches/affine_transformations.rs index ac68d6e..1b38428 100644 --- a/benches/affine_transformations.rs +++ b/benches/affine_transformations.rs @@ -12,9 +12,10 @@ macro_rules! bench { 64.try_into().unwrap(), include_bytes!("4_180x180.imgbuf").to_vec(), ); - b.iter(|| { + #[allow(unused_unsafe)] + b.iter(|| unsafe { for _ in 0..256 { - img.flip_h(); + img.$fn(); } }); } diff --git a/src/affine.rs b/src/affine.rs index f50ba30..7404293 100644 --- a/src/affine.rs +++ b/src/affine.rs @@ -27,7 +27,7 @@ impl Image<&mut [u8], CHANNELS> { } /// Flip a image horizontally. - fn flip_h(&mut self) { + pub fn flip_h(&mut self) { for y in 0..self.height() { for x in 0..self.width() / 2 { let x2 = self.width() - x - 1;