Skip to content

Commit 1da041d

Browse files
committed
Remove deprecated error descriptions
Error descriptions are soft-deprecated since 1.27.0, and hard-deprecated since 1.42.0. See also rust-lang/rust#66919
1 parent b79d65d commit 1da041d

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

src/reading.rs

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,6 @@ pub enum OggReadError {
4040
}
4141

4242
impl error::Error for OggReadError {
43-
fn description(&self) -> &str {
44-
match self {
45-
&OggReadError::NoCapturePatternFound => "No Ogg capture pattern found",
46-
&OggReadError::InvalidStreamStructVer(_) =>
47-
"A non zero stream structure version was passed",
48-
&OggReadError::HashMismatch(_, _) => "CRC32 hash mismatch",
49-
&OggReadError::ReadError(_) => "I/O error",
50-
&OggReadError::InvalidData => "Constraint violated",
51-
}
52-
}
53-
5443
fn cause(&self) -> Option<&error::Error> {
5544
match self {
5645
&OggReadError::ReadError(ref err) => Some(err as &error::Error),
@@ -61,7 +50,15 @@ impl error::Error for OggReadError {
6150

6251
impl Display for OggReadError {
6352
fn fmt(&self, fmt :&mut Formatter) -> Result<(), FmtError> {
64-
write!(fmt, "{}", error::Error::description(self))
53+
let description = match self {
54+
&OggReadError::NoCapturePatternFound => "No Ogg capture pattern found",
55+
&OggReadError::InvalidStreamStructVer(_) =>
56+
"A non zero stream structure version was passed",
57+
&OggReadError::HashMismatch(_, _) => "CRC32 hash mismatch",
58+
&OggReadError::ReadError(_) => "I/O error",
59+
&OggReadError::InvalidData => "Constraint violated",
60+
};
61+
write!(fmt, "{}", description)
6562
}
6663
}
6764

0 commit comments

Comments
 (0)