More debug functions to utils.rs
This commit is contained in:
parent
45bd81f883
commit
5a090f5e53
2 changed files with 17 additions and 3 deletions
15
src/utils.rs
15
src/utils.rs
|
@ -36,4 +36,17 @@ pub fn find_elem<S: AsRef<str>>(root: &Element, searched_name: S) -> Option<&Ele
|
|||
}
|
||||
}
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
pub fn print_xml(element: &Element) {
|
||||
use std::io::Write;
|
||||
let mut writer = std::io::stdout();
|
||||
|
||||
let mut xml_writer = minidom::quick_xml::Writer::new_with_indent(
|
||||
std::io::stdout(),
|
||||
0x20, 4
|
||||
);
|
||||
element.to_writer(&mut xml_writer);
|
||||
|
||||
writer.write(&[0x0a]);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue