#![feature(core)]
#![feature(fixed_size_array)]
#![feature(unsafe_no_drop_flag, filling_drop)]
#![feature(associated_type_defaults)]
#![feature(slice_patterns)]
#![feature(unboxed_closures)]
extern crate qcollect_traits;
extern crate qindex_multi;
extern crate raw_vec;
extern crate rustc_serialize;
extern crate core;
pub mod traits { pub use qcollect_traits::*; }
pub mod array_vec;
pub use array_vec::ArrayVec;
pub type ArrayVec4<T> = ArrayVec<T, [T; 4]>;
pub type ArrayVec8<T> = ArrayVec<T, [T; 8]>;
pub type ArrayVec16<T> = ArrayVec<T, [T; 16]>;
pub type ArrayVec24<T> = ArrayVec<T, [T; 24]>;
pub type ArrayVec32<T> = ArrayVec<T, [T; 32]>;
pub mod small_vec;
pub use small_vec::SmallVec;
pub type SmallVec4<T> = SmallVec<T, [T; 4]>;
pub type SmallVec8<T> = SmallVec<T, [T; 8]>;
pub type SmallVec16<T> = SmallVec<T, [T; 16]>;
pub type SmallVec24<T> = SmallVec<T, [T; 24]>;
pub type SmallVec32<T> = SmallVec<T, [T; 32]>;
pub mod flat_map_adaptor;
pub use flat_map_adaptor::FlatMapAdaptor;
pub type FlatMap<K: Ord, V> = FlatMapAdaptor<K, V, Vec<(K, V)>>;
pub type SliceMap<'a, K: Ord, V> = FlatMapAdaptor<K, V, &'a mut [(K, V)]>;
pub type SmallMap4<K: Ord, V> = FlatMapAdaptor<K, V, SmallVec4<(K, V)>>;
pub type SmallMap8<K: Ord, V> = FlatMapAdaptor<K, V, SmallVec8<(K, V)>>;
pub type SmallMap16<K: Ord, V> = FlatMapAdaptor<K, V, SmallVec16<(K, V)>>;
pub mod flat_set_adaptor;
pub use flat_set_adaptor::FlatSetAdaptor;
pub type FlatSet<T: Ord> = FlatSetAdaptor<T, Vec<T>>;
pub type SliceSet<'a, T: Ord> = FlatSetAdaptor<T, &'a mut [T]>;
pub type SmallSet4<T: Ord> = FlatSetAdaptor<T, SmallVec4<T>>;
pub type SmallSet8<T: Ord> = FlatSetAdaptor<T, SmallVec8<T>>;
pub type SmallSet16<T: Ord> = FlatSetAdaptor<T, SmallVec16<T>>;
pub type SmallSet24<T: Ord> = FlatSetAdaptor<T, SmallVec24<T>>;
pub type SmallSet32<T: Ord> = FlatSetAdaptor<T, SmallVec32<T>>;
pub mod by_value;
pub use by_value::ByValue;
use core::array::FixedSizeArray;
pub fn iter_into_fixed<I, A>(iter: I) -> A
where I: Iterator, A: FixedSizeArray<I::Item>
{
iter.collect::<ArrayVec<_, A>>().into_fixed()
}
#[test]
fn test_iter_into_fixed(){
let data = vec![2u32, 5, 10, 20];
let [a, b, c, d]: [_;4] = self::iter_into_fixed(data.iter());
assert_eq!(a, &data[0]);
assert_eq!(b, &data[1]);
assert_eq!(c, &data[2]);
assert_eq!(d, &data[3]);
}