odds 0.2.26

Odds and ends — collection miscellania. Extra functionality for slices (`.find()`, `RevSlice`), strings and other things. Debug checked variants of `get_unchecked` and `slice_unchecked`, and extra methods for strings and vectors: `repeat`, `insert_str` and `splice`. Things in odds may move to more appropriate crates if we find them.
Documentation
#![feature(test)]
extern crate test;

use std::mem::{size_of, size_of_val};
use test::Bencher;

extern crate odds;
use odds::slice::split_aligned_for;
use odds::slice::unalign::UnalignedIter;

fn count_ones(data: &[u8]) -> u32 {
    let mut total = 0;
    let (head, mid, tail) = split_aligned_for::<[u64; 2]>(data);
    total += head.iter().map(|x| x.count_ones()).sum();
    total += mid.iter().map(|x| x[0].count_ones() + x[1].count_ones()).sum();
    total += tail.iter().map(|x| x.count_ones()).sum();
    total
}

fn unalign_count_ones(data: &[u8]) -> u32 {
    let mut total = 0;
    let mut iter = UnalignedIter::<u64>::from_slice(data);
    total += (&mut iter).map(|x| x.count_ones()).sum();
    total += iter.tail().map(|x| x.count_ones()).sum();
    total
}

#[bench]
fn split_count_ones(b: &mut Bencher) {
    let v = vec![3u8; 127];
    b.iter(|| {
        count_ones(&v)
    });
    b.bytes = size_of_val(&v[..]) as u64;
}

#[bench]
fn bench_unalign_count_ones(b: &mut Bencher) {
    let v = vec![3u8; 127];
    b.iter(|| {
        unalign_count_ones(&v)
    });
    b.bytes = size_of_val(&v[..]) as u64;
}