blob: b1d71996fddfd532357784c01d3df6bb29fcd698 [file] [log] [blame]
Brian Silvermancc09f182022-03-09 15:40:20 -08001#[derive(Debug, PartialEq)]
2pub 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}