api: add any_position to get arbitrary one of the positions
api: add any_position to get arbitrary one of the positions

This is 4.5× faster than `positions` for my use case in the following
representative benchmark.

    #![feature(test)]
    extern crate test;

    use serde_json::Value;
    use suffix::SuffixTable;

    fn setup() -> (String, Vec<String>) {
        const JSON: &str = include_str!("twitter.json"); // https://github.com/serde-rs/json-benchmark/tree/master/data
        let json_value: Value = serde_json::from_str(JSON).unwrap();
        let yaml = serde_yaml::to_string(&json_value).unwrap();

        let mut strings = Vec::new();
        let mut stack = Vec::new();
        stack.push(json_value);
        while let Some(value) = stack.pop() {
            match value {
                Value::Null | Value::Bool(_) | Value::Number(_) => {}
                Value::String(string) => strings.push(string),
                Value::Array(array) => stack.extend(array),
                Value::Object(object) => {
                    for (key, value) in object {
                        strings.push(key);
                        stack.push(value);
                    }
                }
            }
        }

        (yaml, strings)
    }

    #[bench]
    fn bench_positions(b: &mut test::Bencher) {
        let (yaml, strings) = setup();
        let index = SuffixTable::new(&yaml);
        b.iter(|| {
            for string in &strings {
                test::black_box(index.positions(string));
            }
        });
    }

    #[bench]
    fn bench_any_position(b: &mut test::Bencher) {
        let (yaml, strings) = setup();
        let index = SuffixTable::new(&yaml);
        b.iter(|| {
            for string in &strings {
                test::black_box(index.any_position(string));
            }
        });
    }

PR #15 
BurntSushi/suffix