location_parser/error.rs
1use std::error;
2use std::fmt;
3
4#[derive(Debug, PartialEq)]
5pub enum Error {
6 InvalidFormat,
7 OutOfRange,
8}
9
10impl fmt::Display for Error {
11 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
12 let s = match self {
13 Error::InvalidFormat => "Invalid format",
14 Error::OutOfRange => "Out of range",
15 };
16 f.write_str(s)
17 }
18}
19
20impl error::Error for Error {}