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, IncorrectFileHeader,
/// Line in `.osu` that contains a slider was not in the proper format. /// Line in `.osu` that contains a slider was not in the proper format.
InvalidCurvePoints, InvalidCurvePoints,
/// Failed to recognized specified type for hitobjects.
UnknownHitObjectKind,
} }
impl fmt::Display for ParseError { impl fmt::Display for ParseError {
@@ -25,7 +23,6 @@ impl fmt::Display for ParseError {
write!(f, "expected `osu file format v` at file begin") write!(f, "expected `osu file format v` at file begin")
} }
Self::InvalidCurvePoints => f.write_str("invalid curve point"), 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::IoError(inner) => Some(inner),
Self::IncorrectFileHeader => None, Self::IncorrectFileHeader => None,
Self::InvalidCurvePoints => None, Self::InvalidCurvePoints => None,
Self::UnknownHitObjectKind => None,
} }
} }
} }
+1 -1
View File
@@ -632,7 +632,7 @@ macro_rules! parse_hitobjects_body {
HitObjectKind::Hold { end_time } HitObjectKind::Hold { end_time }
} else { } else {
return Err(ParseError::UnknownHitObjectKind); continue 'next_line;
}; };
$self.hit_objects.push(HitObject { $self.hit_objects.push(HitObject {