diff options
| author | Gustav Sörnäs <gustav@sornas.net> | 2021-03-22 00:18:39 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-03-22 00:18:39 +0100 |
| commit | 97bfcac402c06fd051f5a8c3c05384d5a2972d50 (patch) | |
| tree | 65f327da854672fb0afc59c7ab66c7a9725258d8 /mumlib/src/error.rs | |
| parent | 4458c3455c467ac0b97fecfd5ff2cbd77b6ac52b (diff) | |
| parent | 433cd3d452ab68236b9347e74b1d8b305b0b4c52 (diff) | |
| download | mum-97bfcac402c06fd051f5a8c3c05384d5a2972d50.tar.gz | |
Merge pull request #70 from mum-rs/dep-maint
Diffstat (limited to 'mumlib/src/error.rs')
| -rw-r--r-- | mumlib/src/error.rs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/mumlib/src/error.rs b/mumlib/src/error.rs index 1e79b9c..8c66068 100644 --- a/mumlib/src/error.rs +++ b/mumlib/src/error.rs @@ -1,6 +1,5 @@ -use serde::export::Formatter; use serde::{Deserialize, Serialize}; -use std::fmt::Display; +use std::fmt; pub type Result<T> = std::result::Result<T, Error>; @@ -13,8 +12,8 @@ pub enum Error { InvalidUsernameError(String), } -impl Display for Error { - fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { +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"), @@ -33,8 +32,8 @@ pub enum ChannelIdentifierError { Ambiguous, } -impl Display for ChannelIdentifierError { - fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { +impl fmt::Display for ChannelIdentifierError { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { ChannelIdentifierError::Invalid => write!(f, "Invalid channel identifier"), ChannelIdentifierError::Ambiguous => write!(f, "Ambiguous channel identifier"), |
