|
@@ -30,6 +30,34 @@ pub enum AskError {
|
|
IOError(std::io::Error),
|
|
IOError(std::io::Error),
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+impl std::fmt::Display for AskError {
|
|
|
|
+ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
|
|
|
+ <AskError as std::fmt::Debug>::fmt(self, f)
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+impl std::error::Error for AskError {
|
|
|
|
+ #[allow(deprecated)]
|
|
|
|
+ fn cause(&self) -> Option<&dyn std::error::Error> {
|
|
|
|
+ match self {
|
|
|
|
+ Self::IOError(e) => e.cause()
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
|
|
|
|
+ match self {
|
|
|
|
+ Self::IOError(e) => e.source()
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ #[allow(deprecated)]
|
|
|
|
+ fn description(&self) -> &str {
|
|
|
|
+ match self {
|
|
|
|
+ Self::IOError(e) => e.description()
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
impl From<std::io::Error> for AskError {
|
|
impl From<std::io::Error> for AskError {
|
|
fn from(value: std::io::Error) -> Self {
|
|
fn from(value: std::io::Error) -> Self {
|
|
Self::IOError(value)
|
|
Self::IOError(value)
|