use super::XMLBuilder; impl XMLBuilder { // Build XML declaration // i.e. pub(crate) fn declaration(mut self) -> Self { self.writer .write(super::XmlEvent::StartDocument { version: super::XmlVersion::Version10, encoding: Some("UTF-8"), standalone: None, }) .expect("should write to buf"); self } } #[cfg(test)] mod tests { use super::*; use std::str; #[test] fn test_declaration() { let b = XMLBuilder::new(); let r = b.declaration().build(); assert_eq!( str::from_utf8(&r).unwrap(), r#""# ); } }