user_idle/error.rs
1use std::fmt;
2
3#[derive(Debug)]
4pub struct Error {
5 pub cause: String,
6}
7
8impl Error {
9 pub fn new<C: Into<String>>(cause: C) -> Error {
10 Error {
11 cause: cause.into(),
12 }
13 }
14}
15
16impl fmt::Display for Error {
17 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
18 write!(f, "{}", self.cause)
19 }
20}