optz/
error.rs

1use std::fmt;
2
3#[derive(Debug)]
4pub enum OptzError {
5  MissingArgument,
6  Parse(String),
7}
8
9impl std::fmt::Display for OptzError {
10  fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
11    match self {
12      OptzError::MissingArgument => write!(f, "Missing argument"),
13      OptzError::Parse(msg) => write!(f, "{}", msg),
14    }
15  }
16}
17
18impl std::error::Error for OptzError {}
19
20pub type Result<T> = std::result::Result<T, OptzError>;