indexed_string 0.1.0

A naive implementation for rust's string to support index, works with unicode in O(n) time.
Documentation
use std::ops::Deref;
use crate::indexed_string::*;

#[test]
fn create_indexed_string() {
    let str = "aaabc";

    let indexed_string = IndexedString::from(str);

    assert_eq!(indexed_string.to_string(), str.to_string());
}

#[test]
fn create_indexed_string_with_unicode() {
    let str = "Café du 🌍";

    let indexed_string = IndexedString::from(str);

    assert_eq!(indexed_string.to_string(), str);
}

#[test]
fn access_indexed_string() {
    let str = "Café du 🌍";

    let indexed_string = IndexedString::from(str);

    println!("{}", indexed_string[8]);

    assert_eq!(indexed_string[8], "🌍");
}

#[test]
fn mutating_index_string() {
    let str = "πŸŒβ€οΈΓ©πŸ’―πŸ‡ΊπŸ‡¦";

    let mut indexed_string = IndexedString::from(str);

    indexed_string[2] = "2".to_string();


    assert_eq!(indexed_string.to_string(), "🌍❀️2πŸ’―πŸ‡ΊπŸ‡¦")
}

#[test]
fn iterator_over_indexed_string() {
    let str = "πŸŒβ€οΈΓ©πŸ’―";

    let indexed_string = IndexedString::from(str);

    for (index, item) in indexed_string.iter().enumerate() {
        match index {
            0 => {
                assert_eq!(item.deref(), "🌍")
            }
            1 => {
                assert_eq!(item.deref(), "❀️")
            }
            2 => {
                assert_eq!(item.deref(), "Γ©")
            }
            3 => {
                assert_eq!(item.deref(), "πŸ’―")
            }
            _ => {
                panic!();
            }
        }
    }


}