image-optimizer 1.3.0

CLI tool for optimizing images (JPEG, PNG, WebP)
Documentation
1
2
3
4
5
6
7
8
9
10
11
use anyhow::Result;
use std::path::PathBuf;

/// Gets the path to the current executable
///
/// # Errors
/// Returns an error if the current executable path cannot be determined
pub fn get_current_executable() -> Result<PathBuf> {
    std::env::current_exe()
        .map_err(|e| anyhow::anyhow!("Failed to get current executable path: {}", e))
}