20 lines
434 B
Rust
20 lines
434 B
Rust
use std::error::Error;
|
|
use std::fmt::{Debug, Display, Formatter, Pointer};
|
|
|
|
pub struct CLIArgumentError(pub &'static str);
|
|
|
|
|
|
impl Display for CLIArgumentError {
|
|
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
|
f.write_str(self.0)
|
|
}
|
|
}
|
|
|
|
impl Debug for CLIArgumentError {
|
|
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
|
write!(f, "{}", self.0)
|
|
}
|
|
}
|
|
|
|
impl Error for CLIArgumentError {}
|