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:
Emmanuel Gil Peyrot 2017-07-20 20:36:13 +01:00
commit 487dbdc6de
28 changed files with 266 additions and 265 deletions

View file

@ -1,4 +1,5 @@
// Copyright (c) 2017 Maxime “pep” Buquet <pep+code@bouah.net>
// Copyright (c) 2017 Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
@ -44,11 +45,11 @@ impl TryFrom<Element> for Muc {
}
}
impl Into<Element> for Muc {
fn into(self) -> Element {
impl From<Muc> for Element {
fn from(muc: Muc) -> Element {
Element::builder("x")
.ns(ns::MUC)
.append(self.password)
.append(muc.password)
.build()
}
}