docx_rs/documents/elements/
q_format.rs1use crate::documents::BuildXML;
2use crate::xml_builder::*;
3use std::io::Write;
4
5#[derive(Default)]
12pub struct QFormat {}
13
14impl QFormat {
15 pub fn new() -> QFormat {
16 Default::default()
17 }
18}
19
20impl BuildXML for QFormat {
21 fn build_to<W: Write>(
22 &self,
23 stream: xml::writer::EventWriter<W>,
24 ) -> xml::writer::Result<xml::writer::EventWriter<W>> {
25 XMLBuilder::from(stream).q_format()?.into_inner()
26 }
27}
28
29#[cfg(test)]
30mod tests {
31
32 use super::*;
33 #[cfg(test)]
34 use pretty_assertions::assert_eq;
35 use std::str;
36
37 #[test]
38 fn test_q_format() {
39 let c = QFormat::new();
40 let b = c.build();
41 assert_eq!(str::from_utf8(&b).unwrap(), r#"<w:qFormat />"#);
42 }
43}