فهرست منبع

error: convertion from std::io::Error added

x 1 ماه پیش
والد
کامیت
b59057e55f
1فایلهای تغییر یافته به همراه6 افزوده شده و 0 حذف شده
  1. 6 0
      src/error.rs

+ 6 - 0
src/error.rs

@@ -66,3 +66,9 @@ impl From<std::io::Error> for Error {
         Self::Io(err.kind())
         Self::Io(err.kind())
     }
     }
 }
 }
+
+impl From<Error> for std::io::Error {
+    fn from(err: Error) -> std::io::Error {
+        std::io::Error::other(err.to_string())
+    }
+}