1
0
mirror of https://gitlab.com/xmpp-rs/xmpp-rs.git synced 2024-07-01 10:58:44 +02:00

hashes: Implement serialise.

This commit is contained in:
Emmanuel Gil Peyrot 2017-04-23 18:36:12 +01:00
parent 78e8a06ec2
commit 20949c2832

View File

@ -28,6 +28,14 @@ pub fn parse_hash(root: &Element) -> Result<Hash, Error> {
})
}
pub fn serialise(hash: &Hash) -> Element {
Element::builder("hash")
.ns(ns::HASHES)
.attr("algo", hash.algo.clone())
.append(hash.hash.clone())
.build()
}
#[cfg(test)]
mod tests {
use minidom::Element;