summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaphael Nestler <raphael.nestler@gmail.com>2016-11-20 16:45:50 +0100
committerRaphael Nestler <raphael.nestler@gmail.com>2016-11-20 16:45:50 +0100
commitc4b1f7ac8d16e6b2572f6c546f9220a9ba79fa25 (patch)
treec4b78dc0397b253580d2b13df4c46df43828b5c2
parenta676f4c148b1f8554fbd759020aaa6fb86317e48 (diff)
downloadimag-c4b1f7ac8d16e6b2572f6c546f9220a9ba79fa25.zip
imag-c4b1f7ac8d16e6b2572f6c546f9220a9ba79fa25.tar.gz
Rename ParseError to IdParseError
-rw-r--r--libimagdiary/src/diaryid.rs12
-rw-r--r--libimagdiary/src/error.rs2
2 files changed, 7 insertions, 7 deletions
diff --git a/libimagdiary/src/diaryid.rs b/libimagdiary/src/diaryid.rs
index 05f95bd..906097d 100644
--- a/libimagdiary/src/diaryid.rs
+++ b/libimagdiary/src/diaryid.rs
@@ -191,7 +191,7 @@ fn component_to_str<'a>(com: Component<'a>) -> Result<&'a str, DE> {
Component::Normal(s) => Some(s),
_ => None,
}.and_then(|s| s.to_str())
- .ok_or(DEK::ParseError.into_error())
+ .ok_or(DEK::IdParseError.into_error())
}
impl FromStoreId for DiaryId {
@@ -204,7 +204,7 @@ impl FromStoreId for DiaryId {
fn next_component<'a>(components: &'a mut Rev<Components>) -> Result<&'a str, DE> {
components.next()
- .ok_or(DEK::ParseError.into_error())
+ .ok_or(DEK::IdParseError.into_error())
.and_then(component_to_str)
}
@@ -222,21 +222,21 @@ impl FromStoreId for DiaryId {
match (hour, minute) {
(Some(h), Some(m)) => Ok((h, m)),
- _ => return Err(DE::new(DEK::ParseError, None)),
+ _ => return Err(DE::new(DEK::IdParseError, None)),
}
}));
let day: Result<u32,_> = next_component(&mut cmps)
.and_then(|s| s.parse::<u32>()
- .map_err_into(DEK::ParseError));
+ .map_err_into(DEK::IdParseError));
let month: Result<u32,_> = next_component(&mut cmps)
.and_then(|s| s.parse::<u32>()
- .map_err_into(DEK::ParseError));
+ .map_err_into(DEK::IdParseError));
let year: Result<i32,_> = next_component(&mut cmps)
.and_then(|s| s.parse::<i32>()
- .map_err_into(DEK::ParseError));
+ .map_err_into(DEK::IdParseError));
let name = next_component(&mut cmps).map(String::from);
diff --git a/libimagdiary/src/error.rs b/libimagdiary/src/error.rs
index d70f896..b5406b1 100644
--- a/libimagdiary/src/error.rs
+++ b/libimagdiary/src/error.rs
@@ -28,7 +28,7 @@ generate_error_module!(
EntryNotInDiary => "Entry not in Diary",
IOError => "IO Error",
ViewError => "Error viewing diary entry",
- ParseError => "Error while parsing"
+ IdParseError => "Error while parsing ID"
);
);