fix(cartridge): trim whitespace from cartridge title
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
b829f05a34
commit
3c2456611e
|
@ -57,7 +57,7 @@ impl Cartridge {
|
||||||
fn find_title(memory: &[u8]) -> Option<String> {
|
fn find_title(memory: &[u8]) -> Option<String> {
|
||||||
let slice = &memory[ROM_TITLE_RANGE];
|
let slice = &memory[ROM_TITLE_RANGE];
|
||||||
let with_nulls = std::str::from_utf8(slice).ok();
|
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 {
|
match trimmed {
|
||||||
Some("") | None => None,
|
Some("") | None => None,
|
||||||
|
|
Loading…
Reference in New Issue