lender 0.6.2

A lending-iterator trait based on higher-rank trait bounds, with full std::iter::Iterator functionality
Documentation
// Test that MapErr (fallible-only adapter) with an invariant lend type fails covariance check.

use std::cell::Cell;

use lender::{FallibleLend, FallibleLender, FallibleLending};

struct InvariantMapErr<E, L, F>(L, F, std::marker::PhantomData<E>);

impl<'lend, E, L, F> FallibleLending<'lend> for InvariantMapErr<E, L, F> {
    type Lend = &'lend Cell<Option<&'lend String>>;
}

impl<E, L, F> FallibleLender for InvariantMapErr<E, L, F> {
    type Error = E;
    lender::check_covariance_fallible!();

    fn next(&mut self) -> Result<Option<FallibleLend<'_, Self>>, Self::Error> {
        Ok(None)
    }
}

fn main() {}