skip parsed line if unknown object type

This commit is contained in:
MaxOhn
2023-02-09 07:41:58 +01:00
parent f645d16bee
commit 9d5a059e0a
2 changed files with 1 additions and 5 deletions
-4
View File
@@ -13,8 +13,6 @@ pub enum ParseError {
IncorrectFileHeader,
/// Line in `.osu` that contains a slider was not in the proper format.
InvalidCurvePoints,
/// Failed to recognized specified type for hitobjects.
UnknownHitObjectKind,
}
impl fmt::Display for ParseError {
@@ -25,7 +23,6 @@ impl fmt::Display for ParseError {
write!(f, "expected `osu file format v` at file begin")
}
Self::InvalidCurvePoints => f.write_str("invalid curve point"),
Self::UnknownHitObjectKind => f.write_str("unsupported hitobject kind"),
}
}
}
@@ -36,7 +33,6 @@ impl StdError for ParseError {
Self::IoError(inner) => Some(inner),
Self::IncorrectFileHeader => None,
Self::InvalidCurvePoints => None,
Self::UnknownHitObjectKind => None,
}
}
}
+1 -1
View File
@@ -632,7 +632,7 @@ macro_rules! parse_hitobjects_body {
HitObjectKind::Hold { end_time }
} else {
return Err(ParseError::UnknownHitObjectKind);
continue 'next_line;
};
$self.hit_objects.push(HitObject {