12 lines
243 B
Rust
Raw Normal View History

use toml::value::Table;
pub trait Config {
fn get_string (&self, key: &str) -> Option<&str>;
}
impl Config for Table {
fn get_string (&self, key: &str) -> Option<&str> {
self.get(key).and_then(|value| value.as_str())
}
}