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

impl<T: Clone, M> Clone for List<Singly<T>, M>
where
    M: MemoryPolicy<Singly<T>>,
    List<Singly<T>, M>: Default,
{
    fn clone(&self) -> Self {
        self.iter().cloned().collect()
    }
}

impl<T: Clone, M> Clone for List<Doubly<T>, M>
where
    M: MemoryPolicy<Doubly<T>>,
    List<Doubly<T>, M>: Default,
{
    fn clone(&self) -> Self {
        self.iter().cloned().collect()
    }
}