rom: Remove end of line chars from names ('@')
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
parent
efc5128890
commit
9a3f604b39
1 changed files with 9 additions and 5 deletions
14
rom/build.rs
14
rom/build.rs
|
@ -79,6 +79,15 @@ fn get_pokemon_list(data: &[u8]) -> Result<Vec<String>, Error> {
|
||||||
// TODO: Ensure we have the right length? a multiple of 10
|
// TODO: Ensure we have the right length? a multiple of 10
|
||||||
|
|
||||||
for (offset, ord) in data.iter().enumerate() {
|
for (offset, ord) in data.iter().enumerate() {
|
||||||
|
if offset != 0 && (offset % 10) == 0 {
|
||||||
|
res.push(buffer.clone());
|
||||||
|
buffer.clear()
|
||||||
|
}
|
||||||
|
|
||||||
|
if *ord == 0x50 { // End char, '@'.
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
let pkstr = match PKString::try_from(&[*ord][..]) {
|
let pkstr = match PKString::try_from(&[*ord][..]) {
|
||||||
Ok(pkstr) => pkstr,
|
Ok(pkstr) => pkstr,
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
|
@ -87,11 +96,6 @@ fn get_pokemon_list(data: &[u8]) -> Result<Vec<String>, Error> {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
if offset != 0 && (offset % 10) == 0 {
|
|
||||||
res.push(buffer.clone());
|
|
||||||
buffer.clear()
|
|
||||||
}
|
|
||||||
|
|
||||||
buffer.push_str(String::from(&pkstr).as_str());
|
buffer.push_str(String::from(&pkstr).as_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue