From 0db408e3ffed1e5618c9bd644ba6c6f9bf7ae558 Mon Sep 17 00:00:00 2001 From: Vomitblood Date: Mon, 25 Mar 2024 23:38:37 +0800 Subject: [PATCH] asdf --- build/arch/PKGBUILD | 2 +- src/main.rs | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) 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<()> {