remove redundant error variant
This commit is contained in:
+1
-11
@@ -1,4 +1,4 @@
|
||||
use std::{error::Error as StdError, fmt, io::Error as IoError, num::ParseFloatError};
|
||||
use std::{error::Error as StdError, fmt, io::Error as IoError};
|
||||
|
||||
/// `Result<_, ParseError>`
|
||||
pub type ParseResult<T> = Result<T, ParseError>;
|
||||
@@ -13,8 +13,6 @@ pub enum ParseError {
|
||||
IncorrectFileHeader,
|
||||
/// Line in `.osu` that contains a slider was not in the proper format.
|
||||
InvalidCurvePoints,
|
||||
/// Expected a decimal number, got something else.
|
||||
InvalidDecimalNumber,
|
||||
/// Failed to recognized specified type for hitobjects.
|
||||
UnknownHitObjectKind,
|
||||
}
|
||||
@@ -27,7 +25,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::InvalidDecimalNumber => f.write_str("invalid float number"),
|
||||
Self::UnknownHitObjectKind => f.write_str("unsupported hitobject kind"),
|
||||
}
|
||||
}
|
||||
@@ -39,7 +36,6 @@ impl StdError for ParseError {
|
||||
Self::IoError(inner) => Some(inner),
|
||||
Self::IncorrectFileHeader => None,
|
||||
Self::InvalidCurvePoints => None,
|
||||
Self::InvalidDecimalNumber => None,
|
||||
Self::UnknownHitObjectKind => None,
|
||||
}
|
||||
}
|
||||
@@ -50,9 +46,3 @@ impl From<IoError> for ParseError {
|
||||
Self::IoError(other)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<ParseFloatError> for ParseError {
|
||||
fn from(_: ParseFloatError) -> Self {
|
||||
Self::InvalidDecimalNumber
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user