Added documentation for Error

This commit is contained in:
DylanCa 2024-01-13 12:36:09 +01:00
parent 56c90e454b
commit df16b83b6e

View file

@ -0,0 +1,18 @@
use std::borrow::Cow;
use std::fmt;
use std::fmt::{Display, Formatter};
/// Custom Error list for the library.
pub enum Error {
DiscordNotFound,
}
impl Display for Error {
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
let msg = match self {
Error::DiscordNotFound => Cow::Borrowed("Could not connect to client. Is Discord running ?"),
};
f.write_str(&msg)
}
}