Replace Into<Element> with From<…> for Element.
This allows Element::from() to work, and since Into<Element> is automatically implemented for any type implementing From there is no change to existing code.
This commit is contained in:
parent
5ec921fa6f
commit
487dbdc6de
28 changed files with 266 additions and 265 deletions
|
|
@ -96,12 +96,12 @@ impl TryFrom<Element> for Hash {
|
|||
}
|
||||
}
|
||||
|
||||
impl Into<Element> for Hash {
|
||||
fn into(self) -> Element {
|
||||
impl From<Hash> for Element {
|
||||
fn from(hash: Hash) -> Element {
|
||||
Element::builder("hash")
|
||||
.ns(ns::HASHES)
|
||||
.attr("algo", self.algo)
|
||||
.append(base64::encode(&self.hash))
|
||||
.attr("algo", hash.algo)
|
||||
.append(base64::encode(&hash.hash))
|
||||
.build()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue