1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use crate::{variant::Doubly, List};
use orx_selfref_col::MemoryPolicy;

impl<T, M> Extend<T> for List<Doubly<T>, M>
where
    M: MemoryPolicy<Doubly<T>>,
{
    fn extend<I: IntoIterator<Item = T>>(&mut self, iter: I) {
        for x in iter {
            self.push_back(x);
        }
    }
}

impl<'a, T: Clone, M> Extend<&'a T> for List<Doubly<T>, M>
where
    M: MemoryPolicy<Doubly<T>>,
{
    fn extend<I: IntoIterator<Item = &'a T>>(&mut self, iter: I) {
        for x in iter {
            self.push_back(x.clone());
        }
    }
}