From f43ad05be5df586444cffbec2eeace16c6cb104c Mon Sep 17 00:00:00 2001 From: pca006132 Date: Thu, 18 Jun 2020 11:33:52 +0800 Subject: [PATCH] Testing for config. --- src/runtime/src/main.rs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/runtime/src/main.rs b/src/runtime/src/main.rs index 5ee4970..f77f3f4 100644 --- a/src/runtime/src/main.rs +++ b/src/runtime/src/main.rs @@ -46,9 +46,18 @@ pub fn main_core0() { ram::init_alloc_linker(); - match config::read_str("foo") { - Ok(val) => info!("read: {}", val), - Err(error) => info!("failed to read config: {}", error), + let mut cfg = config::Config::new().unwrap(); + match cfg.read_str("FOO") { + Ok(val) => info!("FOO = {}", val), + Err(error) => info!("failed to read config FOO: {}", error), + } + match cfg.read_str("BAR") { + Ok(val) => info!("BAR = {}", val), + Err(error) => info!("failed to read config BAR: {}", error), + } + match cfg.read_str("FOOBAR") { + Ok(val) => info!("read FOOBAR = {}", val), + Err(error) => info!("failed to read config FOOBAR: {}", error), } if devc::DevC::new().is_done() {