diff options
| author | Gustav Sörnäs <gustav@sornas.net> | 2021-03-29 21:41:38 +0200 |
|---|---|---|
| committer | Gustav Sörnäs <gustav@sornas.net> | 2021-03-29 21:41:38 +0200 |
| commit | 6e71b1fee95e5f320bbc27e4148ff48e0d390073 (patch) | |
| tree | 5d1e845f8aee5895806c4df84b39def9b757356a /mumlib/src/error.rs | |
| parent | 5af72d30bb1b34cbde1c3ba5e73b7c694461ae51 (diff) | |
| download | mum-6e71b1fee95e5f320bbc27e4148ff48e0d390073.tar.gz | |
remove error suffix on error variants
Diffstat (limited to 'mumlib/src/error.rs')
| -rw-r--r-- | mumlib/src/error.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/mumlib/src/error.rs b/mumlib/src/error.rs index 0259c28..f6a02a7 100644 --- a/mumlib/src/error.rs +++ b/mumlib/src/error.rs @@ -5,24 +5,24 @@ pub type Result<T> = std::result::Result<T, Error>; #[derive(Clone, Debug, Serialize, Deserialize)] pub enum Error { - DisconnectedError, - AlreadyConnectedError, + Disconnected, + AlreadyConnected, ChannelIdentifierError(String, ChannelIdentifierError), - InvalidServerAddrError(String, u16), - InvalidUsernameError(String), + InvalidServerAddr(String, u16), + InvalidUsername(String), InvalidServerPassword, } impl fmt::Display for Error { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { - Error::DisconnectedError => write!(f, "Not connected to a server"), - Error::AlreadyConnectedError => write!(f, "Already connected to a server"), + Error::Disconnected=> write!(f, "Not connected to a server"), + Error::AlreadyConnected=> write!(f, "Already connected to a server"), Error::ChannelIdentifierError(id, kind) => write!(f, "{}: {}", kind, id), - Error::InvalidServerAddrError(addr, port) => { + Error::InvalidServerAddr(addr, port) => { write!(f, "Invalid server address: {}: {}", addr, port) } - Error::InvalidUsernameError(username) => write!(f, "Invalid username: {}", username), + Error::InvalidUsername(username) => write!(f, "Invalid username: {}", username), Error::InvalidServerPassword => write!(f, "Invalid server password") } } |
