diff --git a/build/arch/PKGBUILD b/build/arch/PKGBUILD index 5d78ca6..5842d0b 100644 --- a/build/arch/PKGBUILD +++ b/build/arch/PKGBUILD @@ -3,7 +3,7 @@ pkgname=rustmon-git pkgdesc="Pokemon Colorscripts written in Rust" _gitname=rustmon -pkgver=r26.2b2a15c +pkgver=r27.a575677 pkgrel=1 arch=('x86_64') url="https://github.com/Vomitblood/$_gitname" diff --git a/src/main.rs b/src/main.rs index d41b6d4..64e87e3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -27,16 +27,15 @@ const GENERATIONS: [(&str, (u32, u32)); 8] = [ ]; fn print_file(filepath: &str) -> std::io::Result<()> { - if let Some(file) = ColorScriptsDir::get(filepath) { - let content = std::str::from_utf8(file.data.as_ref()).unwrap(); - println!("{}", content); - Ok(()) - } else { - Err(std::io::Error::new( + ColorScriptsDir::get(filepath) + .map(|file| { + let content = std::str::from_utf8(file.data.as_ref()).unwrap(); + println!("{}", content); + }) + .ok_or(std::io::Error::new( std::io::ErrorKind::NotFound, "File not found", )) - } } fn list_pokemon_names() -> std::io::Result<()> {