From 9bce9fdc82cbcb4bdc84d3490d7cc755aae935f3 Mon Sep 17 00:00:00 2001 From: lukeflo Date: Fri, 8 Nov 2024 15:36:56 +0100 Subject: simplify bibdata sourcing --- src/bibiman.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/bibiman.rs') diff --git a/src/bibiman.rs b/src/bibiman.rs index b07512d..a573ee7 100644 --- a/src/bibiman.rs +++ b/src/bibiman.rs @@ -375,7 +375,7 @@ impl Bibiman { // 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) - .arg(&filepath) + .arg(&filepath.as_ref().unwrap()) .stdout(Stdio::null()) .stderr(Stdio::null()) .spawn() @@ -386,7 +386,11 @@ impl Bibiman { pub fn open_doi_url(&mut self) -> Result<()> { let idx = self.entry_table.entry_table_state.selected().unwrap(); - let web_adress = self.entry_table.entry_table_items[idx].doi_url.clone(); + let web_adress = self.entry_table.entry_table_items[idx] + .doi_url + .as_ref() + .unwrap(); + // .clone(); // Resolve strings using the resolving function of dx.doi.org, so the // terminal is not blocked by the resolving process @@ -397,7 +401,7 @@ impl Bibiman { let prefix = "https://".to_string(); prefix + &web_adress } else { - web_adress + web_adress.to_string() }; // Build command to execute browser. 'xdg-open' is Linux standard -- cgit v1.2.3