network: Remove unused error variants

Remove unused error variants from `network::Error`.
This commit is contained in:
Tobin C. Harding 2022-05-25 12:32:35 +10:00
parent e67e97bb37
commit 5c6d369289
1 changed files with 1 additions and 8 deletions

View File

@ -53,18 +53,12 @@ pub mod stream_reader;
pub enum Error {
/// And I/O error
Io(io::Error),
/// Socket mutex was poisoned
SocketMutexPoisoned,
/// Not connected to peer
SocketNotConnectedToPeer,
}
impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
Error::Io(ref e) => fmt::Display::fmt(e, f),
Error::SocketMutexPoisoned => f.write_str("socket mutex was poisoned"),
Error::SocketNotConnectedToPeer => f.write_str("not connected to peer"),
}
}
}
@ -76,8 +70,7 @@ impl std::error::Error for Error {
use self::Error::*;
match self {
Io(e) => Some(e),
SocketMutexPoisoned | SocketNotConnectedToPeer => None,
Io(e) => Some(e)
}
}
}