Skip to content

Commit ba96eaf

Browse files
committed
Add __Nonexhaustive to HttpsConnectorError to make it nonexaustive to the API users
1 parent 0707b23 commit ba96eaf

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/error.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ pub enum HttpsConnectorError<E: Send> {
66
HttpConnector(E),
77
/// `native_tls` failed when setting up a TLS connection.
88
NativeTls(native_tls::Error),
9+
10+
#[doc(hidden)]
11+
__Nonexhaustive,
912
}
1013

1114
impl<E: Send + std::fmt::Debug> std::fmt::Debug for HttpsConnectorError<E> {
@@ -22,6 +25,7 @@ impl<E: Send + std::fmt::Debug> std::fmt::Debug for HttpsConnectorError<E> {
2225
.debug_tuple("HttpsConnectorError::NativeTls")
2326
.field(err)
2427
.finish(),
28+
HttpsConnectorError::__Nonexhaustive => unimplemented!(),
2529
}
2630
}
2731
}
@@ -34,6 +38,7 @@ impl<E: Send + std::fmt::Display> std::fmt::Display for HttpsConnectorError<E> {
3438
}
3539
HttpsConnectorError::HttpConnector(err) => write!(f, "http connector error: {}", err),
3640
HttpsConnectorError::NativeTls(err) => write!(f, "native tls error: {}", err),
41+
HttpsConnectorError::__Nonexhaustive => unimplemented!(),
3742
}
3843
}
3944
}
@@ -44,6 +49,7 @@ impl<E: Send + std::error::Error + 'static> std::error::Error for HttpsConnector
4449
HttpsConnectorError::ForceHttpsButUriNotHttps => None,
4550
HttpsConnectorError::HttpConnector(err) => Some(err),
4651
HttpsConnectorError::NativeTls(err) => Some(err),
52+
HttpsConnectorError::__Nonexhaustive => unimplemented!(),
4753
}
4854
}
4955
}

0 commit comments

Comments
 (0)