toml_test/
error.rs

1#[derive(Debug, Clone, PartialEq, Eq)]
2pub struct Error {
3    message: String,
4}
5
6impl Error {
7    pub fn new(message: impl ToString) -> Self {
8        Self {
9            message: message.to_string(),
10        }
11    }
12}
13
14impl std::fmt::Display for Error {
15    fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
16        self.message.fmt(formatter)
17    }
18}
19
20impl std::error::Error for Error {}