xml: Rename XmlDeError to XmlError

This commit is contained in:
Lennart
2025-01-15 18:15:04 +01:00
parent 95f7912947
commit d74f0ba660
14 changed files with 52 additions and 53 deletions

View File

@@ -22,12 +22,12 @@ pub const LOCAL_DATE: &str = "%Y%m%d";
pub struct UtcDateTime(DateTime<Utc>);
impl ValueDeserialize for UtcDateTime {
fn deserialize(val: &str) -> Result<Self, rustical_xml::XmlDeError> {
fn deserialize(val: &str) -> Result<Self, rustical_xml::XmlError> {
let input = <String as ValueDeserialize>::deserialize(val)?;
Ok(Self(
NaiveDateTime::parse_from_str(&input, UTC_DATE_TIME)
.map_err(|_| {
rustical_xml::XmlDeError::Other("Could not parse as UTC timestamp".to_owned())
rustical_xml::XmlError::Other("Could not parse as UTC timestamp".to_owned())
})?
.and_utc(),
))