Skip to main content

rs_docx/font_table/
pitch.rs

1use hard_xml::{XmlRead, XmlWrite};
2use std::borrow::Cow;
3
4#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
5#[cfg_attr(test, derive(PartialEq))]
6#[xml(tag = "w:pitch")]
7pub struct Pitch<'a> {
8    #[xml(attr = "w:val")]
9    pub value: Option<Cow<'a, str>>,
10}
11
12impl<'a, S: Into<Cow<'a, str>>> From<S> for Pitch<'a> {
13    fn from(s: S) -> Self {
14        Pitch {
15            value: Some(s.into()),
16        }
17    }
18}