mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-14 10:32:19 +00:00
xml: Unparsed, add fix for empty tags
This commit is contained in:
@@ -45,17 +45,20 @@ impl XmlDeserialize for Unit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO: actually implement
|
// TODO: actually implement
|
||||||
|
#[derive(Debug, Clone, PartialEq)]
|
||||||
pub struct Unparsed(BytesStart<'static>);
|
pub struct Unparsed(BytesStart<'static>);
|
||||||
|
|
||||||
impl XmlDeserialize for Unparsed {
|
impl XmlDeserialize for Unparsed {
|
||||||
fn deserialize<R: BufRead>(
|
fn deserialize<R: BufRead>(
|
||||||
reader: &mut quick_xml::NsReader<R>,
|
reader: &mut quick_xml::NsReader<R>,
|
||||||
start: &BytesStart,
|
start: &BytesStart,
|
||||||
_empty: bool,
|
empty: bool,
|
||||||
) -> Result<Self, XmlDeError> {
|
) -> Result<Self, XmlDeError> {
|
||||||
// let reader_cloned = NsReader::from_reader(reader.get_ref().to_owned());
|
// let reader_cloned = NsReader::from_reader(reader.get_ref().to_owned());
|
||||||
let mut buf = vec![];
|
if !empty {
|
||||||
reader.read_to_end_into(start.name(), &mut buf)?;
|
let mut buf = vec![];
|
||||||
|
reader.read_to_end_into(start.name(), &mut buf)?;
|
||||||
|
}
|
||||||
Ok(Self(start.to_owned()))
|
Ok(Self(start.to_owned()))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user