minidom: Add a blanket impl for From<Into<Element>> for Node.

This commit is contained in:
Emmanuel Gil Peyrot 2019-11-03 18:49:11 +01:00
commit 877d5c21da
2 changed files with 5 additions and 37 deletions

View file

@ -182,9 +182,11 @@ impl Node {
}
}
impl From<Element> for Node {
fn from(elm: Element) -> Node {
Node::Element(elm)
impl<I> From<I> for Node
where I: Into<Element>
{
fn from(elm: I) -> Node {
Node::Element(elm.into())
}
}