use std::collections::HashMap;
#[derive(Debug, Clone, PartialEq, Eq, Default)]
pub struct FormatTable {
table: HashMap<String, String>,
}
impl FormatTable {
pub fn new() -> Self {
Self {
table: HashMap::new(),
}
}
pub fn add_entry(&mut self, key: impl Into<String>, value: impl Into<String>) {
self.table
.insert(key.into().to_ascii_lowercase(), value.into());
}
pub fn add_table(&mut self, table: impl IntoIterator<Item = (String, String)>) {
self.table.extend(table);
}
pub fn table(&self) -> &HashMap<String, String> {
&self.table
}
}