clige_rs/error/
mod.rs

1//! Contains error types.
2
3/// Custom error enum.
4#[derive(Debug, Clone)]
5pub enum GameError {
6    InvalidAction,
7    InvalidTarget
8}
9
10impl GameError{
11    pub fn what(&self) -> &str {
12        match *self {
13            Self::InvalidAction => "Invalid action",
14            Self::InvalidTarget => "Invalid target"
15        }
16    }
17}