From 3c2456611e96a0fa8a9c0397377bbec2181ea9b4 Mon Sep 17 00:00:00 2001 From: Rekai Musuka Date: Thu, 19 Aug 2021 21:53:36 -0500 Subject: [PATCH] fix(cartridge): trim whitespace from cartridge title --- src/cartridge.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cartridge.rs b/src/cartridge.rs index 65e82b1..0898f78 100644 --- a/src/cartridge.rs +++ b/src/cartridge.rs @@ -57,7 +57,7 @@ impl Cartridge { fn find_title(memory: &[u8]) -> Option { let slice = &memory[ROM_TITLE_RANGE]; let with_nulls = std::str::from_utf8(slice).ok(); - let trimmed = with_nulls.map(|s| s.trim_matches('\0')); + let trimmed = with_nulls.map(|s| s.trim_matches('\0').trim()); match trimmed { Some("") | None => None,