Files
asusctl/asus-nb-ctrl/src/error.rs
2020-08-04 20:08:09 +12:00

20 lines
454 B
Rust

use std::fmt;
#[derive(Debug)]
pub enum RogError {
ParseFanLevel,
NotSupported,
}
impl std::error::Error for RogError {}
impl fmt::Display for RogError {
// This trait requires `fmt` with this exact signature.
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
RogError::ParseFanLevel => write!(f, "Parse error"),
RogError::NotSupported => write!(f, "Not supported"),
}
}
}