blob: ae55b768b65536787a4b6e991a8c60c799934791 [file] [log] [blame]
Adam Snaider1c095c92023-07-08 02:09:58 -04001#[derive(Debug, PartialEq, Eq)]
Brian Silvermancc09f182022-03-09 15:40:20 -08002pub struct LabelError(pub String);
3
4impl std::fmt::Display for LabelError {
5 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6 write!(f, "{}", self.0)
7 }
8}
9
10impl std::error::Error for LabelError {
11 fn description(&self) -> &str {
12 &self.0
13 }
14}
15
16impl From<String> for LabelError {
17 fn from(msg: String) -> Self {
18 Self(msg)
19 }
20}