Drop dependency on try_from.

This bumps the minimum supported stable Rust version to 1.34.

The TryFrom and TryInto traits are still reexported to not break the
API, but these reexports are deprecated and will be removed in a future
release.
This commit is contained in:
Emmanuel Gil Peyrot 2019-04-12 10:58:42 +02:00
commit 5bf14b0b22
54 changed files with 91 additions and 92 deletions

View file

@ -11,7 +11,7 @@ use crate::ns;
use crate::pubsub::{ItemId, NodeName, Subscription, SubscriptionId, Item as PubSubItem};
use jid::Jid;
use minidom::Element;
use try_from::TryFrom;
use std::convert::TryFrom;
/// Event wrapper for a PubSub `<item/>`.
#[derive(Debug, Clone)]
@ -132,7 +132,7 @@ fn parse_items(elem: Element, node: NodeName) -> Result<PubSubEvent, Error> {
}
impl TryFrom<Element> for PubSubEvent {
type Err = Error;
type Error = Error;
fn try_from(elem: Element) -> Result<PubSubEvent, Error> {
check_self!(elem, "event", PUBSUB_EVENT);

View file

@ -11,7 +11,7 @@ use crate::ns;
use crate::pubsub::{NodeName, Subscription, SubscriptionId, Item as PubSubItem};
use jid::Jid;
use minidom::Element;
use try_from::TryFrom;
use std::convert::TryFrom;
// TODO: a better solution would be to split this into a query and a result elements, like for
// XEP-0030.
@ -191,7 +191,7 @@ pub struct SubscribeOptions {
}
impl TryFrom<Element> for SubscribeOptions {
type Err = Error;
type Error = Error;
fn try_from(elem: Element) -> Result<Self, Error> {
check_self!(elem, "subscribe-options", PUBSUB);
@ -340,7 +340,7 @@ impl IqSetPayload for PubSub {}
impl IqResultPayload for PubSub {}
impl TryFrom<Element> for PubSub {
type Err = Error;
type Error = Error;
fn try_from(elem: Element) -> Result<PubSub, Error> {
check_self!(elem, "pubsub", PUBSUB);