use std::hash::Hash;
pub trait Unwinds<K, V>: IntoIterator<Item=(K, V)> where
Self: Sized,
K: Hash + Eq
{
fn move_unwind(self) -> (Vec<K>, Vec<V>) where
{
let some: (Vec<K>, Vec<V>) = self.into_iter().unzip();
return some;
}
}
impl<K, V, I> Unwinds<K, V> for I where
I: IntoIterator<Item=(K, V)>,
K: Hash + Eq {}
#[cfg(test)]
mod test {
use veho::entries::unwind;
#[test]
fn test_move_unwind() {
let tuples = vec![
(1, 10.0),
(2, 20.0),
(3, 30.0),
];
let (a, b) = unwind(tuples);
println!("{:?}", a);
println!("{:?}", b);
}
}