use std::io; #[cfg(windows)] use std::path::Path; #[cfg(windows)] use winres::WindowsResource; fn main() -> io::Result<()> { // ---- Windows Icon ---- #[cfg(windows)] { let iconpath = "assets/windows/Icon.ico"; if Path::new(iconpath).exists() { WindowsResource::new() .set_icon("assets/windows/Icon.ico") .compile()?; } } // Return Ok Ok(()) }