impl Deref for Configuration

This commit is contained in:
Matthias Beyer 2016-03-26 19:49:58 +01:00
parent a36c213cec
commit 86929c819c

View file

@ -1,5 +1,6 @@
use std::path::PathBuf; use std::path::PathBuf;
use std::result::Result as RResult; use std::result::Result as RResult;
use std::ops::Deref;
use toml::{Parser, Value}; use toml::{Parser, Value};
@ -169,6 +170,15 @@ impl Configuration {
} }
impl Deref for Configuration {
type Target = Value;
fn deref(&self) -> &Value {
&self.config
}
}
fn get_verbosity(v: &Value) -> bool { fn get_verbosity(v: &Value) -> bool {
match v { match v {
&Value::Table(ref t) => t.get("verbose") &Value::Table(ref t) => t.get("verbose")