Skip to content

Commit 96d854b

Browse files
authored
minor: fix new clippy lint failures with rust 1.42.0 (#148)
1 parent aa4fe08 commit 96d854b

File tree

3 files changed

+25
-5
lines changed

3 files changed

+25
-5
lines changed

src/decoder/error.rs

+10-2
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,16 @@ impl fmt::Display for DecoderError {
8181
impl error::Error for DecoderError {
8282
fn description(&self) -> &str {
8383
match *self {
84-
DecoderError::IoError(ref inner) => inner.description(),
85-
DecoderError::FromUtf8Error(ref inner) => inner.description(),
84+
DecoderError::IoError(ref inner) =>
85+
{
86+
#[allow(deprecated)]
87+
inner.description()
88+
}
89+
DecoderError::FromUtf8Error(ref inner) =>
90+
{
91+
#[allow(deprecated)]
92+
inner.description()
93+
}
8694
DecoderError::UnrecognizedElementType(_) => "unrecognized element type",
8795
DecoderError::InvalidArrayKey(..) => "invalid array key",
8896
DecoderError::ExpectedField(_) => "expected a field",

src/encoder/error.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,11 @@ impl fmt::Display for EncoderError {
4545
impl error::Error for EncoderError {
4646
fn description(&self) -> &str {
4747
match *self {
48-
EncoderError::IoError(ref inner) => inner.description(),
48+
EncoderError::IoError(ref inner) =>
49+
{
50+
#[allow(deprecated)]
51+
inner.description()
52+
}
4953
EncoderError::InvalidMapKeyType(_) => "Invalid map key type",
5054
EncoderError::Unknown(ref inner) => inner,
5155
EncoderError::UnsupportedUnsignedType => "BSON does not support unsigned type",

src/oid.rs

+10-2
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,16 @@ impl error::Error for Error {
6969
fn description(&self) -> &str {
7070
match *self {
7171
Error::ArgumentError(ref inner) => &inner,
72-
Error::FromHexError(ref inner) => inner.description(),
73-
Error::IoError(ref inner) => inner.description(),
72+
Error::FromHexError(ref inner) =>
73+
{
74+
#[allow(deprecated)]
75+
inner.description()
76+
}
77+
Error::IoError(ref inner) =>
78+
{
79+
#[allow(deprecated)]
80+
inner.description()
81+
}
7482
Error::HostnameError => "Failed to retrieve hostname for OID generation.",
7583
}
7684
}

0 commit comments

Comments
 (0)