From 86929c819caeb3ba011c5e087bb51e11c796b561 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 26 Mar 2016 19:49:58 +0100 Subject: [PATCH] impl Deref for Configuration --- libimagrt/src/configuration.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libimagrt/src/configuration.rs b/libimagrt/src/configuration.rs index 6b4319f1..53e2f659 100644 --- a/libimagrt/src/configuration.rs +++ b/libimagrt/src/configuration.rs @@ -1,5 +1,6 @@ use std::path::PathBuf; use std::result::Result as RResult; +use std::ops::Deref; 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 { match v { &Value::Table(ref t) => t.get("verbose")