blob: 5713aa0a30d41c5f67b732921629e65ebfe277c8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
use std::error::Error;
use std::fmt;
#[derive(Debug)]
pub struct ParseRangeError {
source_str: String,
}
impl ParseRangeError {
pub fn new(source_str: &str) -> Self {
ParseRangeError {
source_str: String::from(source_str),
}
}
}
impl fmt::Display for ParseRangeError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.source_str)
}
}
impl Error for ParseRangeError {}
|