Add doctest for prefix fn

This commit is contained in:
Maxime “pep” Buquet 2017-12-30 17:24:54 +01:00
parent 7d009923b7
commit e250e9cf2c

View file

@ -192,6 +192,17 @@ impl Element {
}
/// Returns a reference to the prefix of this element.
///
/// # Examples
/// ```rust
/// use minidom::Element;
///
/// let elem = Element::builder("prefix:name")
/// .build();
///
/// assert_eq!(elem.name(), "name");
/// assert_eq!(elem.prefix(), Some("prefix".to_owned()));
/// ```
pub fn prefix(&self) -> Option<String> {
self.prefix.clone()
}