pub fn bin_dir() -> Result<PathBuf> {
    if let Some(dir) = dirs::executable_dir() {
        // Attempt to create the directory if it doesn't exist
        if !dir.exists() {
            fs::create_dir_all(&dir)?;
        }

        Ok(dir)
    }
    else {
        // If we get None, we're likely on Windows.
        let msg = concat!(
            "Could not find suitable install-dir.\n",
            "Consider passing --install-dir to manually specify",
        );

        Err(anyhow!(msg))
    }
}
// Find a suitable bindir for installing to.
Find a suitable bindir for installing to.
Find a suitable bindir for installing to .
pub fn bin_dir() -> Result<PathBuf> {
    if let Some(dir) = dirs::executable_dir() {
        // Attempt to create the directory if it doesn't exist
        if !dir.exists() {
            fs::create_dir_all(&dir)?;
        }
        Ok(dir)
    }
    else {
        // If we get None, we're likely on Windows.
        let msg = concat!(
            "Could not find suitable install-dir.\n",
            "Consider passing --install-dir to manually specify",
        );
        Err(anyhow!(msg))
    }
}
pub fn bin_dir ( ) -> Result < PathBuf > { if let Some ( dir ) = dirs :: executable_dir ( ) { // Attempt to create the directory if it doesn't exist if ! dir . exists ( ) { fs :: create_dir_all ( & dir ) ? ; } Ok ( dir ) } else { // If we get None, we're likely on Windows. let msg = concat ! ( " \n " " " ) ; Err ( anyhow ! ( msg ) ) } }
Find a suitable bindir for installing to.
Find a suitable bindir for installing to .