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
10
src/delay.rs
10
src/delay.rs
|
|
@ -45,13 +45,13 @@ impl TryFrom<Element> for Delay {
|
|||
}
|
||||
}
|
||||
|
||||
impl Into<Element> for Delay {
|
||||
fn into(self) -> Element {
|
||||
impl From<Delay> for Element {
|
||||
fn from(delay: Delay) -> Element {
|
||||
Element::builder("delay")
|
||||
.ns(ns::DELAY)
|
||||
.attr("from", self.from.and_then(|value| Some(String::from(value))))
|
||||
.attr("stamp", self.stamp.to_rfc3339())
|
||||
.append(self.data)
|
||||
.attr("from", delay.from.and_then(|value| Some(String::from(value))))
|
||||
.attr("stamp", delay.stamp.to_rfc3339())
|
||||
.append(delay.data)
|
||||
.build()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue