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
|
|
@ -47,13 +47,13 @@ impl TryFrom<Element> for ECaps2 {
|
|||
}
|
||||
}
|
||||
|
||||
impl Into<Element> for ECaps2 {
|
||||
fn into(mut self) -> Element {
|
||||
impl From<ECaps2> for Element {
|
||||
fn from(mut ecaps2: ECaps2) -> Element {
|
||||
Element::builder("c")
|
||||
.ns(ns::ECAPS2)
|
||||
.append(self.hashes.drain(..)
|
||||
.map(|hash| hash.into())
|
||||
.collect::<Vec<Element>>())
|
||||
.append(ecaps2.hashes.drain(..)
|
||||
.map(|hash| hash.into())
|
||||
.collect::<Vec<Element>>())
|
||||
.build()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue