ref_wrapper 0.1.4

Wrapper of dynamically borrowed data.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! Provider of [`RefIter`].

use crate::RefWrap;
use std::ops::DerefMut;

/// Iterator version of [`RefWrap`].
pub type RefIter<'a, T> = RefWrap<'a, dyn Iterator<Item = T>>;

impl<'a, T> Iterator for RefIter<'a, T>
where
    T: 'a,
{
    type Item = T;

    fn next(&mut self) -> Option<Self::Item> {
        self.deref_mut().next()
    }
}