From 77d2b189fb4fc363603a677fa9acc3323c7636a7 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 2 Jan 2016 15:39:57 +0100 Subject: [PATCH] Configuration does not store verbose/debugging flag information --- src/configuration.rs | 26 +------------------------- src/runtime.rs | 4 ++-- 2 files changed, 3 insertions(+), 27 deletions(-) diff --git a/src/configuration.rs b/src/configuration.rs index d926c61b..7671bef7 100644 --- a/src/configuration.rs +++ b/src/configuration.rs @@ -17,8 +17,6 @@ use cli::CliConfig; pub struct Configuration { pub rtp : String, pub store_sub : String, - pub verbose : bool, - pub debugging : bool, pub editor : Option, pub editor_opts : String, } @@ -31,23 +29,17 @@ impl Configuration { let cfg = fetch_config(&rtp); - let verbose = cfg.lookup_boolean("verbose").unwrap_or(false); - let debugging = cfg.lookup_boolean("debug").unwrap_or(false); let store_sub = String::from(cfg.lookup_str("store").unwrap_or("/store")); let editor = cfg.lookup_str("editor").map(String::from); let editor_opts = String::from(cfg.lookup_str("editor-opts").unwrap_or("")); debug!("Building configuration"); - debug!(" - verbose : {}", verbose); - debug!(" - debugging : {}", debugging); debug!(" - store sub : {}", store_sub); debug!(" - runtimepath: {}", rtp); debug!(" - editor : {:?}", editor); debug!(" - editor-opts: {}", editor_opts); Configuration { - verbose: verbose, - debugging: debugging, store_sub: store_sub, rtp: rtp, editor: editor, @@ -55,20 +47,6 @@ impl Configuration { } } - /** - * Check whether the configuration says we should run verbose - */ - pub fn is_verbose(&self) -> bool { - self.verbose - } - - /** - * Check whether the configuration says we should run in debugging - */ - pub fn is_debugging(&self) -> bool { - self.debugging - } - /** * Get the store path the configuration configured */ @@ -128,9 +106,7 @@ fn default_path() -> Option { impl Debug for Configuration { fn fmt(&self, f: &mut Formatter) -> Result<(), Error> { - write!(f, "Configuration (verbose: {}, debugging: {}, rtp: {}, store path: {})", - self.is_verbose(), - self.is_debugging(), + write!(f, "Configuration (rtp: {}, store path: {})", self.get_rtp(), self.store_path() ) diff --git a/src/runtime.rs b/src/runtime.rs index 20b269a8..9ccce2f2 100644 --- a/src/runtime.rs +++ b/src/runtime.rs @@ -77,14 +77,14 @@ impl<'a> Runtime<'a> { * Check whether we run verbose */ pub fn is_verbose(&self) -> bool { - self.config.is_verbose() || self.configuration.is_verbose() + self.config.is_verbose() } /** * Check whether we run in debugging */ pub fn is_debugging(&self) -> bool { - self.config.is_debugging() || self.configuration.is_verbose() + self.config.is_debugging() } /**