|
@@ -17,12 +17,13 @@ pub fn load_ksudoku(filename: std::path::PathBuf) -> Result<String, Box<dyn Erro
|
|
|
|
|
|
for e in parser {
|
|
|
match e {
|
|
|
- Ok(XmlEvent::StartElement { name, .. }) => {
|
|
|
+ Ok(XmlEvent::StartElement { name, attributes, .. }) => {
|
|
|
element_name = name.local_name.clone();
|
|
|
if element_name == "graph" {
|
|
|
// Check the attributes here
|
|
|
// <graph specific-type="Plain" type="sudoku" order="9"/>
|
|
|
// Verify these are correct / not some other puzzle type!
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
Ok(XmlEvent::Characters(text)) => {
|
|
@@ -79,6 +80,8 @@ pub fn save_ksudoku(
|
|
|
event = WrXmlEvent::end_element().into();
|
|
|
writer.write(event)?;
|
|
|
|
|
|
+ // Apparently, the events are consumed...
|
|
|
+
|
|
|
event = WrXmlEvent::end_element().into();
|
|
|
writer.write(event)?;
|
|
|
event = WrXmlEvent::end_element().into();
|