From f60be8b6b1e5987613081c9ad8d63a26a1a1bac9 Mon Sep 17 00:00:00 2001 From: lukeflo Date: Wed, 19 Feb 2025 21:42:57 +0100 Subject: remove some comments, update README --- src/app.rs | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) (limited to 'src/app.rs') diff --git a/src/app.rs b/src/app.rs index e03f8d7..55f49de 100644 --- a/src/app.rs +++ b/src/app.rs @@ -364,15 +364,6 @@ impl App { pub fn open_connected_file(cfg: &BibiConfig, file: &OsStr) -> Result<()> { // Build command to execute pdf-reader. 'xdg-open' is Linux standard - // TODO: make custom opener command possible through config - // let cmd = { - // match std::env::consts::OS { - // "linux" => String::from("xdg-open"), - // "macos" => String::from("open"), - // "windows" => String::from("start"), - // _ => panic!("Couldn't detect OS for setting correct opener"), - // } - // }; let cmd = match &cfg.general.pdf_opener { Some(c) => c, None => &select_opener(), @@ -397,15 +388,6 @@ 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 - // TODO: make custom opener command possible through config - // let cmd = { - // match std::env::consts::OS { - // "linux" => String::from("xdg-open"), - // "macos" => String::from("open"), - // "windows" => String::from("start"), - // _ => panic!("Couldn't detect OS for setting correct opener"), - // } - // }; let cmd = match &cfg.general.url_opener { Some(c) => c, None => &select_opener(), @@ -433,8 +415,8 @@ pub fn prepare_weblink(url: &str) -> String { } } -fn expand_home(path: &PathBuf) -> PathBuf { - // let path = PathBuf::from(path); +/// Expand leading tilde (`~`) to `/home/user` +pub fn expand_home(path: &PathBuf) -> PathBuf { if path.starts_with("~") { let mut home = dirs::home_dir().unwrap(); let path = path.strip_prefix("~").unwrap(); -- cgit v1.2.3