Fix TimeTracking::get_timetrack_tag() for Entry

This commit is contained in:
Matthias Beyer 2017-07-20 23:02:48 +02:00
parent d381702e8c
commit 157f6c0129

View file

@ -66,9 +66,10 @@ impl TimeTracking for Entry {
self.get_header()
.read(DATE_TIME_TAG_HEADER_PATH)
.map_err_into(TTEK::HeaderReadError)
.map(|value| match value {
Some(&Value::String(ref s)) => s.clone().into(),
_ => unimplemented!(),
.and_then(|value| match value {
Some(&Value::String(ref s)) => Ok(s.clone().into()),
Some(_) => Err(TTEK::HeaderFieldTypeError.into_error()),
_ => Err(TTEK::HeaderReadError.into_error())
})
}