1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
use crate::StringMap;
use std::fmt::{self, Debug};

impl Default for StringMap {
    fn default() -> Self {
        StringMap(Default::default())
    }
}

impl Debug for StringMap {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        f.debug_map().entries(self.0.iter().map(|(k, v)| (k, &v.1))).finish()
    }
}
/*
impl<T> Index<&str,T> for StringMap {
    type Output = T;

    fn index(&self, key: &str) -> &Self::Output {
        self.get::<T>(key).unwrap()
    }
}
*/
/*
impl IndexMut<&str> for StringMap {
    fn index_mut(&mut self, key: &str) -> &mut Self::Output {
        &mut self.index(key)
    }
}
*/