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
31
32
33
34
35
36
37
38
use super::*;

impl ImportantSet {
    pub fn insert<T>(&mut self, value: T) -> bool
    where
        T: Into<String>,
    {
        self.important = false;
        self.set.insert(value.into())
    }
    pub fn insert_important<T>(&mut self, value: T) -> bool
    where
        T: Into<String>,
    {
        self.important = true;
        self.set.insert(value.into())
    }
    pub fn is_empty(&self) -> bool {
        self.set.is_empty()
    }
}

impl ImportantMap {
    pub fn insert<K, V>(&mut self, key: K, value: V) -> bool
    where
        K: Into<String>,
        V: Into<String>,
    {
        self.map.insert(key.into(), (false, value.into())).is_some()
    }
    pub fn insert_important<K, V>(&mut self, key: K, value: V) -> bool
    where
        K: Into<String>,
        V: Into<String>,
    {
        self.map.insert(key.into(), (true, value.into())).is_some()
    }
}