From 2349d7365eb38f8192aa01d6dfa8162a85730a6b Mon Sep 17 00:00:00 2001 From: Max Bradbury Date: Sat, 12 Mar 2022 18:34:30 +0000 Subject: [PATCH] misc --- src/lib.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 9afd193..b27060e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -5,7 +5,7 @@ mod colour; mod config; mod entity; mod image; -mod mock; +pub mod mock; mod music; mod palette; mod scene; @@ -224,10 +224,9 @@ impl Game { Ok(Game { config, images, tiles, palettes, music, entities, scenes }) } - // todo Result<&Image>? - pub fn get_image_by_name(&self, name: String) -> Option<&Image> { + pub fn get_image_by_name(&self, name: &String) -> Option<&Image> { for image in self.images.iter() { - if image.name == name { + if &image.name == name { return Some(&image); } }