parse: trim special character too

This commit is contained in:
MaxOhn
2021-02-08 17:37:02 +01:00
parent 09e88c2872
commit 802df83a57
+6 -2
View File
@@ -136,7 +136,11 @@ impl Beatmap {
loop { loop {
reader.read_line(&mut buf)?; reader.read_line(&mut buf)?;
if !buf.trim().is_empty() { // Check for character U+FEFF specifically thanks to map id 797130
if !buf
.trim_matches(|c: char| c.is_whitespace() || c == '')
.is_empty()
{
break; break;
} }
@@ -638,7 +642,7 @@ mod tests {
#[test] #[test]
fn parsing() { fn parsing() {
let map_id = if cfg!(feature = "osu") { let map_id = if cfg!(feature = "osu") {
61843 797130
} else if cfg!(feature = "mania") { } else if cfg!(feature = "mania") {
1355822 1355822
} else if cfg!(feature = "fruits") { } else if cfg!(feature = "fruits") {