diff options
author | ClementTsang <cjhtsang@uwaterloo.ca> | 2021-08-26 16:49:20 -0400 |
---|---|---|
committer | ClementTsang <cjhtsang@uwaterloo.ca> | 2021-08-28 04:16:12 -0400 |
commit | 0afc371eaa9a608861ff79f5a2164e578ac0014f (patch) | |
tree | ff38b34439369283ff59f2d1e05248452e3083a1 /src/options.rs | |
parent | dd7e183ec8a152d5fda84c49a7f79141171e1448 (diff) |
refactor: start moving over drawing system
In particular, moving over table-style widgets
Diffstat (limited to 'src/options.rs')
-rw-r--r-- | src/options.rs | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/options.rs b/src/options.rs index da3102b1..a238c354 100644 --- a/src/options.rs +++ b/src/options.rs @@ -242,16 +242,14 @@ pub fn build_app(matches: &clap::ArgMatches<'static>, config: &mut Config) -> Re todo!() } else if let Some(row) = &config.row { create_layout_tree(row, process_defaults, &app_config_fields)? + } else if get_use_battery(matches, config) { + let rows = toml::from_str::<Config>(DEFAULT_BATTERY_LAYOUT)? + .row + .unwrap(); + create_layout_tree(&rows, process_defaults, &app_config_fields)? } else { - if get_use_battery(matches, config) { - let rows = toml::from_str::<Config>(DEFAULT_BATTERY_LAYOUT)? - .row - .unwrap(); - create_layout_tree(&rows, process_defaults, &app_config_fields)? - } else { - let rows = toml::from_str::<Config>(DEFAULT_LAYOUT)?.row.unwrap(); - create_layout_tree(&rows, process_defaults, &app_config_fields)? - } + let rows = toml::from_str::<Config>(DEFAULT_LAYOUT)?.row.unwrap(); + create_layout_tree(&rows, process_defaults, &app_config_fields)? }; let disk_filter = |