Skip to content

Commit d4e4a99

Browse files
kornelskiemilio
authored andcommitted
Remove deprecated Error::description
1 parent 5d38f2a commit d4e4a99

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

src/codegen/error.rs

+4-12
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,19 @@ pub enum Error {
1515

1616
impl fmt::Display for Error {
1717
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
18-
write!(f, "{}", error::Error::description(self))
19-
}
20-
}
21-
22-
impl error::Error for Error {
23-
fn cause(&self) -> Option<&dyn error::Error> {
24-
None
25-
}
26-
27-
fn description(&self) -> &'static str {
28-
match *self {
18+
f.write_str(match *self {
2919
Error::NoLayoutForOpaqueBlob => {
3020
"Tried to generate an opaque blob, but had no layout"
3121
}
3222
Error::InstantiationOfOpaqueType => {
3323
"Instantiation of opaque template type or partial template \
3424
specialization"
3525
}
36-
}
26+
})
3727
}
3828
}
3929

30+
impl error::Error for Error {}
31+
4032
/// A `Result` of `T` or an error of `bindgen::codegen::error::Error`.
4133
pub type Result<T> = ::std::result::Result<T, Error>;

0 commit comments

Comments
 (0)