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

@ -45,9 +45,9 @@ impl TryFrom<Element> for ChatState {
}
}
impl Into<Element> for ChatState {
fn into(self) -> Element {
Element::builder(match self {
impl From<ChatState> for Element {
fn from(chatstate: ChatState) -> Element {
Element::builder(match chatstate {
ChatState::Active => "active",
ChatState::Composing => "composing",
ChatState::Gone => "gone",