fix implicit lifetime warning

This commit is contained in:
bunnie 2024-12-02 18:54:26 +08:00
parent 83e26ff4c7
commit e4e6db8bc9
2 changed files with 2 additions and 2 deletions

View file

@ -55,7 +55,7 @@ const THRESHOLD: i16 = u8::MAX as i16 / 2;
impl<'a, I: Iterator<Item = u8>> Dither<'a, I> {
// const THRESHOLD: i16 = u8::MAX as i16 / 2; results in: cannot satisfy `<_ as Iterator>::Item == u8`
fn new(iter: I, diffusion: &'a Vec<(isize, isize, i16)>, width: usize) -> Dither<I> {
fn new(iter: I, diffusion: &'a Vec<(isize, isize, i16)>, width: usize) -> Dither<'a, I> {
let mut denominator: i16 = 0;
for (_, _, mul) in diffusion {
denominator += mul;

View file

@ -353,7 +353,7 @@ impl<'a, Backing: SenresMut> Writer<'a, Backing> {
impl<'a, Backing: Senres> Reader<'a, Backing> {
pub fn try_get_from<T: RecDes<Backing>>(&self) -> Result<T, ()> { T::try_get_from(self) }
pub fn try_get_ref_from<T: RecDesRef<'a, Backing> + ?Sized>(&'a self) -> Result<&T, ()> {
pub fn try_get_ref_from<T: RecDesRef<'a, Backing> + ?Sized>(&'a self) -> Result<&'a T, ()> {
T::try_get_ref_from(self)
}