aboutsummaryrefslogtreecommitdiff
path: root/src/app.rs
diff options
context:
space:
mode:
authorlukeflo2025-02-19 21:42:57 +0100
committerlukeflo2025-02-19 21:42:57 +0100
commitf60be8b6b1e5987613081c9ad8d63a26a1a1bac9 (patch)
treeccab6a52dd2112f070e5ce6526bd942b54be2806 /src/app.rs
parentdc5ded8160177864963a31476c2a7afe8ca8e834 (diff)
downloadbibiman-f60be8b6b1e5987613081c9ad8d63a26a1a1bac9.tar.gz
bibiman-f60be8b6b1e5987613081c9ad8d63a26a1a1bac9.zip
remove some comments, update README
Diffstat (limited to 'src/app.rs')
-rw-r--r--src/app.rs22
1 files changed, 2 insertions, 20 deletions
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();