extern crate collectioner; use collectioner::VecMore; #[test] fn test_move_to() { let mut from = vec![1, 2, 3, 4]; let mut to = vec![]; from.move_to(&mut to, |i| i % 2 == 0); assert_eq!(from, vec![1, 3]); assert_eq!(to, vec![4, 2]); } #[test] fn test_move_to_zero() { let mut from = vec![1, 2, 3, 4]; let mut to = vec![]; from.move_to(&mut to, |i| *i < 0); assert_eq!(from, vec![1, 2, 3, 4]); assert_eq!(to, vec![]); }