Some small fixes on recurrence expansion

This commit is contained in:
Lennart
2025-12-31 19:54:06 +01:00
parent 9c1cd24d32
commit 44ae995f29
12 changed files with 887 additions and 46 deletions

View File

@@ -5,14 +5,14 @@ use quick_xml::events::BytesStart;
use crate::{XmlDeserialize, XmlError};
// TODO: actually implement
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Unparsed(BytesStart<'static>);
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Unparsed(String);
impl Unparsed {
#[must_use]
pub fn tag_name(&self) -> String {
// TODO: respect namespace?
String::from_utf8_lossy(self.0.local_name().as_ref()).to_string()
self.0.clone()
}
}
@@ -27,6 +27,7 @@ impl XmlDeserialize for Unparsed {
let mut buf = vec![];
reader.read_to_end_into(start.name(), &mut buf)?;
}
Ok(Self(start.to_owned()))
let tag_name = String::from_utf8_lossy(start.local_name().as_ref()).to_string();
Ok(Self(tag_name))
}
}