From 63d4410fdfe7712faec287aee2f5c0ca288dc996 Mon Sep 17 00:00:00 2001 From: lukeflo Date: Sat, 22 Feb 2025 00:48:41 +0100 Subject: replace Config crate with Figment -> better merging of default and config values --- src/bibiman.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/bibiman.rs') diff --git a/src/bibiman.rs b/src/bibiman.rs index b8ef2c6..e36d268 100644 --- a/src/bibiman.rs +++ b/src/bibiman.rs @@ -85,8 +85,8 @@ impl Bibiman { // Constructs a new instance of [`App`]. pub fn new(args: &mut CLIArgs, cfg: &mut BibiConfig) -> Result { let mut main_bibfiles: Vec = args.pos_args.clone(); - if cfg.general.as_ref().unwrap().bibfiles.is_some() { - main_bibfiles.append(cfg.general.as_mut().unwrap().bibfiles.as_mut().unwrap()) + if cfg.general.bibfiles.is_some() { + main_bibfiles.append(cfg.general.bibfiles.as_mut().unwrap()) }; let main_bibfiles = cliargs::parse_files(main_bibfiles); let main_biblio = BibiSetup::new(&main_bibfiles); @@ -381,7 +381,7 @@ impl Bibiman { tui.exit()?; // Use VISUAL or EDITOR. Set "vi" as last fallback let mut cmd: Command = EditorBuilder::new() - .source(cfg.general.as_ref().unwrap().editor.clone()) + .source(cfg.general.editor.as_ref()) .environment() .source(Some("vi")) .build() -- cgit v1.2.3