12 lines
243 B
Rust
12 lines
243 B
Rust
|
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())
|
||
|
}
|
||
|
}
|