aboutsummaryrefslogtreecommitdiff
path: root/src/app.rs
diff options
context:
space:
mode:
authorlukeflo2025-02-22 00:48:41 +0100
committerlukeflo2025-02-22 00:48:41 +0100
commit63d4410fdfe7712faec287aee2f5c0ca288dc996 (patch)
treecdc1c3a2fa012c9c194766c256572129ae069a92 /src/app.rs
parent9cfed78e434a165d4cc01a869dfa7066b8b29819 (diff)
downloadbibiman-63d4410fdfe7712faec287aee2f5c0ca288dc996.tar.gz
bibiman-63d4410fdfe7712faec287aee2f5c0ca288dc996.zip
replace Config crate with Figment -> better merging of default and config values
Diffstat (limited to 'src/app.rs')
-rw-r--r--src/app.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/app.rs b/src/app.rs
index 7869304..e41defc 100644
--- a/src/app.rs
+++ b/src/app.rs
@@ -357,7 +357,7 @@ impl App {
pub fn open_connected_file(cfg: &BibiConfig, file: &OsStr) -> Result<()> {
// Build command to execute pdf-reader. 'xdg-open' is Linux standard
- let cmd = cfg.general.as_ref().unwrap().pdf_opener.as_ref().unwrap();
+ let cmd = &cfg.general.pdf_opener;
// If necessary, replace ~ with /home dir
let file = PathBuf::from(file);
@@ -377,7 +377,7 @@ pub fn open_connected_file(cfg: &BibiConfig, file: &OsStr) -> Result<()> {
pub fn open_connected_link(cfg: &BibiConfig, link: &str) -> Result<()> {
// Build command to execute pdf-reader. 'xdg-open' is Linux standard
- let cmd = cfg.general.as_ref().unwrap().url_opener.as_ref().unwrap();
+ let cmd = &cfg.general.url_opener;
// Pass filepath as argument, pipe stdout and stderr to /dev/null
// to keep the TUI clean (where is it piped on Windows???)
let _ = Command::new(cmd)