Remove public Error constructor from io::Error (#420)
This commit is contained in:
16
src/error.rs
16
src/error.rs
@@ -73,6 +73,12 @@ impl Error {
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn from_io(err: io::Error) -> Self {
|
||||
Error {
|
||||
kind: Kind::Io(err),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<proto::Error> for Error {
|
||||
@@ -88,14 +94,6 @@ impl From<proto::Error> for Error {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<io::Error> for Error {
|
||||
fn from(src: io::Error) -> Error {
|
||||
Error {
|
||||
kind: Kind::Io(src),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Reason> for Error {
|
||||
fn from(src: Reason) -> Error {
|
||||
Error {
|
||||
@@ -109,7 +107,7 @@ impl From<SendError> for Error {
|
||||
match src {
|
||||
SendError::User(e) => e.into(),
|
||||
SendError::Connection(reason) => reason.into(),
|
||||
SendError::Io(e) => e.into(),
|
||||
SendError::Io(e) => Error::from_io(e),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user