parse: trim special character too
This commit is contained in:
+6
-2
@@ -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") {
|
||||||
|
|||||||
Reference in New Issue
Block a user