fast image operations
fix warns
| -rw-r--r-- | src/scale/traits.rs | 6 | ||||
| -rw-r--r-- | src/show.rs | 2 | ||||
| -rw-r--r-- | src/term/sixel.rs | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/src/scale/traits.rs b/src/scale/traits.rs index 68c2b16..647f3bd 100644 --- a/src/scale/traits.rs +++ b/src/scale/traits.rs @@ -40,7 +40,7 @@ pub trait ToImageView<const N: usize>: Sealed { #[doc(hidden)] type P: fr::PixelExt + fr::Convolution; #[doc(hidden)] - fn wrap(i: Image<&[u8], N>) -> fr::ImageView<Self::P>; + fn wrap(i: Image<&[u8], N>) -> fr::ImageView<'_, Self::P>; } /// helper @@ -60,7 +60,7 @@ macro_rules! tiv { ($n:literal, $which:ident) => { impl ToImageView<$n> for ChannelCount<$n> { type P = fr::$which; - fn wrap(i: Image<&[u8], $n>) -> fr::ImageView<Self::P> { + fn wrap(i: Image<&[u8], $n>) -> fr::ImageView<'_, Self::P> { // SAFETY: same conds unsafe { fr::ImageView::new(i.width, i.height, i.buffer()) } } @@ -77,7 +77,7 @@ macro_rules! adiv { ($n:literal, $which:ident) => { impl AlphaDiv<$n> for ChannelCount<$n> { type P = fr::$which; - fn handle(i: Image<&mut [u8], $n>) -> fr::Image<<Self as AlphaDiv<$n>>::P> { + fn handle(i: Image<&mut [u8], $n>) -> fr::Image<'_, <Self as AlphaDiv<$n>>::P> { // SAFETY: we kinda have the same conditions let mut i = unsafe { fr::Image::from_slice_u8(i.width, i.height, i.take_buffer()) }; // SAFETY: mhm diff --git a/src/show.rs b/src/show.rs index 21b73a3..dc1ee4f 100644 --- a/src/show.rs +++ b/src/show.rs @@ -3,7 +3,7 @@ use crate::Image; #[cfg(feature = "real-show")] mod real { use crate::Image; - use minifb::{Key, Window, WindowOptions}; + use minifb::{Key, Window}; pub fn show<const CHANNELS: usize>(i: Image<&[u8], CHANNELS>) where diff --git a/src/term/sixel.rs b/src/term/sixel.rs index a1fca2f..9b18074 100644 --- a/src/term/sixel.rs +++ b/src/term/sixel.rs @@ -119,7 +119,7 @@ impl<T: AsRef<[u8]>, const N: usize> Sixel<T, N> { ( v[0].1.0 as i32, v.iter() - .map(|&(_, (_, y))| (1 << y)) + .map(|&(_, (_, y))| 1 << y) .fold(0, |acc, x| acc | x), ) }) { |