pub fn expand_tilde(dir: PathBuf) -> PathBuf {
        if dir.starts_with("~") {
            let without_home = dir.strip_prefix("~").unwrap();
            return dirs_next::home_dir().unwrap().join(without_home);
        }
        dir
    }
/// Convert a `~` in a path to the home directory
Convert a `~` in a path to the home directory
Convert a ` ~ ` in a path to the home directory
pub fn expand_tilde(dir: PathBuf) -> PathBuf {
        if dir.starts_with("~") {
            let without_home = dir.strip_prefix("~").unwrap();
            return dirs_next::home_dir().unwrap().join(without_home);
        }
        dir
    }
pub fn expand_tilde ( dir : PathBuf ) -> PathBuf { if dir . starts_with ( " " ) { let without_home = dir . strip_prefix ( " " ) . unwrap ( ) ; return dirs_next :: home_dir ( ) . unwrap ( ) . join ( without_home ) ; } dir }
Convert a `~` in a path to the home directory
Convert a ` ~ ` in a path to the home directory
dir
PathBuf