diff --git a/src/lib.rs b/src/lib.rs index 1441d3642092f9f45369cfae585324b1e7083642..a2ac4606bd172782dcc853cdf64ff8370053f759 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -59,6 +59,7 @@ use std::vec; /// months.clear(); /// assert!(months.is_empty()); /// ``` +#[derive(Clone)] pub struct VecMap<V> { v: Vec<Option<V>>, } @@ -91,18 +92,6 @@ impl<V> Default for VecMap<V> { fn default() -> VecMap<V> { VecMap::new() } } -impl<V:Clone> Clone for VecMap<V> { - #[inline] - fn clone(&self) -> VecMap<V> { - VecMap { v: self.v.clone() } - } - - #[inline] - fn clone_from(&mut self, source: &VecMap<V>) { - self.v.clone_from(&source.v); - } -} - impl<V: Hash> Hash for VecMap<V> { fn hash<H: Hasher>(&self, state: &mut H) { // In order to not traverse the `VecMap` twice, count the elements