Cargo.toml 🔗
@@ -23,7 +23,6 @@ sha2 = "0.8"
sha3 = "0.8"
blake2 = "0.8"
chrono = "0.4.5"
-try_from = "0.3.2"
[features]
# Build xmpp-parsers to make components instead of clients.
Emmanuel Gil Peyrot created
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.
Cargo.toml | 1 -
examples/generate-caps.rs | 2 +-
src/attention.rs | 2 +-
src/avatar.rs | 2 +-
src/bind.rs | 4 ++--
src/blocking.rs | 4 ++--
src/bookmarks.rs | 2 +-
src/caps.rs | 4 ++--
src/chatstates.rs | 2 +-
src/component.rs | 2 +-
src/data_forms.rs | 6 +++---
src/delay.rs | 2 +-
src/disco.rs | 4 ++--
src/ecaps2.rs | 2 +-
src/eme.rs | 2 +-
src/forwarding.rs | 2 +-
src/hashes.rs | 2 +-
src/ibb.rs | 2 +-
src/ibr.rs | 4 ++--
src/idle.rs | 2 +-
src/iq.rs | 4 ++--
src/jingle.rs | 6 +++---
src/jingle_dtls_srtp.rs | 2 +-
src/jingle_ft.rs | 8 ++++----
src/jingle_ibb.rs | 2 +-
src/jingle_ice_udp.rs | 2 +-
src/jingle_message.rs | 4 ++--
src/jingle_rtp.rs | 2 +-
src/jingle_s5b.rs | 4 ++--
src/lib.rs | 2 +-
src/mam.rs | 4 ++--
src/media_element.rs | 2 +-
src/message.rs | 4 ++--
src/message_correct.rs | 2 +-
src/mood.rs | 2 +-
src/muc/muc.rs | 2 +-
src/muc/user.rs | 4 ++--
src/nick.rs | 2 +-
src/ping.rs | 2 +-
src/presence.rs | 4 ++--
src/pubsub/event.rs | 4 ++--
src/pubsub/pubsub.rs | 6 +++---
src/receipts.rs | 2 +-
src/roster.rs | 2 +-
src/rsm.rs | 6 +++---
src/sasl.rs | 6 +++---
src/server_info.rs | 4 ++--
src/sm.rs | 2 +-
src/stanza_error.rs | 4 ++--
src/stanza_id.rs | 2 +-
src/stream.rs | 2 +-
src/util/macros.rs | 22 +++++++++++-----------
src/version.rs | 2 +-
src/websocket.rs | 2 +-
54 files changed, 91 insertions(+), 92 deletions(-)
@@ -23,7 +23,6 @@ sha2 = "0.8"
sha3 = "0.8"
blake2 = "0.8"
chrono = "0.4.5"
-try_from = "0.3.2"
[features]
# Build xmpp-parsers to make components instead of clients.
@@ -4,10 +4,10 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
+use std::convert::TryFrom;
use std::io::{self, Read};
use std::env;
use xmpp_parsers::{
- TryFrom,
Element,
disco::DiscoInfoResult,
caps::{Caps, compute_disco as compute_disco_caps, hash_caps},
@@ -21,7 +21,7 @@ mod tests {
#[cfg(not(feature = "disable-validation"))]
use crate::util::error::Error;
use minidom::Element;
- use try_from::TryFrom;
+ use std::convert::TryFrom;
#[test]
fn test_size() {
@@ -60,7 +60,7 @@ mod tests {
use crate::hashes::Algo;
use crate::util::error::Error;
use minidom::Element;
- use try_from::TryFrom;
+ use std::convert::TryFrom;
#[cfg(target_pointer_width = "32")]
#[test]
@@ -10,7 +10,7 @@ use crate::ns;
use jid::Jid;
use minidom::Element;
use std::str::FromStr;
-use try_from::TryFrom;
+use std::convert::TryFrom;
/// The request for resource binding, which is the process by which a client
/// can obtain a full JID and start exchanging on the XMPP network.
@@ -43,7 +43,7 @@ impl IqSetPayload for Bind {}
impl IqResultPayload for Bind {}
impl TryFrom<Element> for Bind {
- type Err = Error;
+ type Error = Error;
fn try_from(elem: Element) -> Result<Bind, Error> {
check_self!(elem, "bind", BIND);
@@ -9,7 +9,7 @@ use crate::iq::{IqGetPayload, IqResultPayload, IqSetPayload};
use crate::ns;
use jid::Jid;
use minidom::Element;
-use try_from::TryFrom;
+use std::convert::TryFrom;
generate_empty_element!(
/// The element requesting the blocklist, the result iq will contain a
@@ -31,7 +31,7 @@ macro_rules! generate_blocking_element {
}
impl TryFrom<Element> for $elem {
- type Err = Error;
+ type Error = Error;
fn try_from(elem: Element) -> Result<$elem, Error> {
check_self!(elem, $name, BLOCKING);
@@ -72,7 +72,7 @@ mod tests {
use super::*;
use crate::util::compare_elements::NamespaceAwareCompare;
use minidom::Element;
- use try_from::TryFrom;
+ use std::convert::TryFrom;
#[cfg(target_pointer_width = "32")]
#[test]
@@ -17,7 +17,7 @@ use minidom::Element;
use sha1::Sha1;
use sha2::{Sha256, Sha512};
use sha3::{Sha3_256, Sha3_512};
-use try_from::TryFrom;
+use std::convert::TryFrom;
/// Represents a capability hash for a given client.
#[derive(Debug, Clone)]
@@ -40,7 +40,7 @@ pub struct Caps {
impl PresencePayload for Caps {}
impl TryFrom<Element> for Caps {
- type Err = Error;
+ type Error = Error;
fn try_from(elem: Element) -> Result<Caps, Error> {
check_self!(elem, "c", CAPS, "caps");
@@ -35,7 +35,7 @@ mod tests {
use crate::util::error::Error;
use crate::ns;
use minidom::Element;
- use try_from::TryFrom;
+ use std::convert::TryFrom;
#[test]
fn test_size() {
@@ -44,7 +44,7 @@ impl Handshake {
mod tests {
use super::*;
use minidom::Element;
- use try_from::TryFrom;
+ use std::convert::TryFrom;
#[cfg(target_pointer_width = "32")]
#[test]
@@ -8,7 +8,7 @@ use crate::util::error::Error;
use crate::media_element::MediaElement;
use crate::ns;
use minidom::Element;
-use try_from::TryFrom;
+use std::convert::TryFrom;
generate_element!(
/// Represents one of the possible values for a list- field.
@@ -100,7 +100,7 @@ impl Field {
}
impl TryFrom<Element> for Field {
- type Err = Error;
+ type Error = Error;
fn try_from(elem: Element) -> Result<Field, Error> {
check_self!(elem, "field", DATA_FORMS);
@@ -215,7 +215,7 @@ pub struct DataForm {
}
impl TryFrom<Element> for DataForm {
- type Err = Error;
+ type Error = Error;
fn try_from(elem: Element) -> Result<DataForm, Error> {
check_self!(elem, "x", DATA_FORMS);
@@ -35,7 +35,7 @@ mod tests {
use crate::util::error::Error;
use minidom::Element;
use std::str::FromStr;
- use try_from::TryFrom;
+ use std::convert::TryFrom;
#[cfg(target_pointer_width = "32")]
#[test]
@@ -10,7 +10,7 @@ use crate::iq::{IqGetPayload, IqResultPayload};
use crate::ns;
use jid::Jid;
use minidom::Element;
-use try_from::TryFrom;
+use std::convert::TryFrom;
generate_element!(
/// Structure representing a `<query xmlns='http://jabber.org/protocol/disco#info'/>` element.
@@ -115,7 +115,7 @@ pub struct DiscoInfoResult {
impl IqResultPayload for DiscoInfoResult {}
impl TryFrom<Element> for DiscoInfoResult {
- type Err = Error;
+ type Error = Error;
fn try_from(elem: Element) -> Result<DiscoInfoResult, Error> {
check_self!(elem, "query", DISCO_INFO, "disco#info result");
@@ -176,7 +176,7 @@ mod tests {
use super::*;
use crate::util::error::Error;
use minidom::Element;
- use try_from::TryFrom;
+ use std::convert::TryFrom;
#[cfg(target_pointer_width = "32")]
#[test]
@@ -26,7 +26,7 @@ mod tests {
use super::*;
use crate::util::error::Error;
use minidom::Element;
- use try_from::TryFrom;
+ use std::convert::TryFrom;
#[cfg(target_pointer_width = "32")]
#[test]
@@ -28,7 +28,7 @@ mod tests {
use super::*;
use crate::util::error::Error;
use minidom::Element;
- use try_from::TryFrom;
+ use std::convert::TryFrom;
#[cfg(target_pointer_width = "32")]
#[test]
@@ -168,7 +168,7 @@ impl Deref for Sha1HexAttribute {
mod tests {
use super::*;
use minidom::Element;
- use try_from::TryFrom;
+ use std::convert::TryFrom;
#[cfg(target_pointer_width = "32")]
#[test]
@@ -75,7 +75,7 @@ mod tests {
use crate::util::error::Error;
use minidom::Element;
use std::error::Error as StdError;
- use try_from::TryFrom;
+ use std::convert::TryFrom;
#[cfg(target_pointer_width = "32")]
#[test]
@@ -10,7 +10,7 @@ use crate::iq::{IqGetPayload, IqResultPayload, IqSetPayload};
use crate::ns;
use minidom::Element;
use std::collections::HashMap;
-use try_from::TryFrom;
+use std::convert::TryFrom;
/// Query for registering against a service.
#[derive(Debug, Clone)]
@@ -36,7 +36,7 @@ impl IqSetPayload for Query {}
impl IqResultPayload for Query {}
impl TryFrom<Element> for Query {
- type Err = Error;
+ type Error = Error;
fn try_from(elem: Element) -> Result<Query, Error> {
check_self!(elem, "query", REGISTER, "IBR query");
@@ -25,7 +25,7 @@ mod tests {
use minidom::Element;
use std::error::Error as StdError;
use std::str::FromStr;
- use try_from::TryFrom;
+ use std::convert::TryFrom;
#[test]
fn test_size() {
@@ -11,7 +11,7 @@ use crate::stanza_error::StanzaError;
use jid::Jid;
use minidom::Element;
use minidom::IntoAttributeValue;
-use try_from::TryFrom;
+use std::convert::TryFrom;
/// Should be implemented on every known payload of an `<iq type='get'/>`.
pub trait IqGetPayload: TryFrom<Element> + Into<Element> {}
@@ -130,7 +130,7 @@ impl Iq {
}
impl TryFrom<Element> for Iq {
- type Err = Error;
+ type Error = Error;
fn try_from(root: Element) -> Result<Iq, Error> {
check_self!(root, "iq", DEFAULT_NS);
@@ -11,7 +11,7 @@ use jid::Jid;
use minidom::Element;
use std::collections::BTreeMap;
use std::str::FromStr;
-use try_from::TryFrom;
+use std::convert::TryFrom;
generate_attribute!(
/// The action attribute.
@@ -368,7 +368,7 @@ pub struct ReasonElement {
}
impl TryFrom<Element> for ReasonElement {
- type Err = Error;
+ type Error = Error;
fn try_from(elem: Element) -> Result<ReasonElement, Error> {
check_self!(elem, "reason", JINGLE);
@@ -497,7 +497,7 @@ impl Jingle {
}
impl TryFrom<Element> for Jingle {
- type Err = Error;
+ type Error = Error;
fn try_from(root: Element) -> Result<Jingle, Error> {
check_self!(root, "jingle", JINGLE, "Jingle");
@@ -50,7 +50,7 @@ generate_element!(
mod tests {
use super::*;
use minidom::Element;
- use try_from::TryFrom;
+ use std::convert::TryFrom;
#[cfg(target_pointer_width = "32")]
#[test]
@@ -12,7 +12,7 @@ use crate::ns;
use minidom::Element;
use std::collections::BTreeMap;
use std::str::FromStr;
-use try_from::TryFrom;
+use std::convert::TryFrom;
generate_element!(
/// Represents a range in a file.
@@ -128,7 +128,7 @@ impl File {
}
impl TryFrom<Element> for File {
- type Err = Error;
+ type Error = Error;
fn try_from(elem: Element) -> Result<File, Error> {
check_self!(elem, "file", JINGLE_FT);
@@ -253,7 +253,7 @@ pub struct Description {
}
impl TryFrom<Element> for Description {
- type Err = Error;
+ type Error = Error;
fn try_from(elem: Element) -> Result<Description, Error> {
check_self!(elem, "description", JINGLE_FT, "JingleFT description");
@@ -301,7 +301,7 @@ pub struct Checksum {
}
impl TryFrom<Element> for Checksum {
- type Err = Error;
+ type Error = Error;
fn try_from(elem: Element) -> Result<Checksum, Error> {
check_self!(elem, "checksum", JINGLE_FT);
@@ -27,7 +27,7 @@ mod tests {
use crate::util::error::Error;
use minidom::Element;
use std::error::Error as StdError;
- use try_from::TryFrom;
+ use std::convert::TryFrom;
#[cfg(target_pointer_width = "32")]
#[test]
@@ -92,7 +92,7 @@ generate_element!(
mod tests {
use super::*;
use minidom::Element;
- use try_from::TryFrom;
+ use std::convert::TryFrom;
use crate::hashes::Algo;
use crate::jingle_dtls_srtp::Setup;
@@ -8,7 +8,7 @@ use crate::util::error::Error;
use crate::jingle::SessionId;
use crate::ns;
use minidom::Element;
-use try_from::TryFrom;
+use std::convert::TryFrom;
/// Defines a protocol for broadcasting Jingle requests to all of the clients
/// of a user.
@@ -48,7 +48,7 @@ fn check_empty_and_get_sid(elem: Element) -> Result<SessionId, Error> {
}
impl TryFrom<Element> for JingleMI {
- type Err = Error;
+ type Error = Error;
fn try_from(elem: Element) -> Result<JingleMI, Error> {
if !elem.has_ns(ns::JINGLE_MESSAGE) {
@@ -76,7 +76,7 @@ generate_element!(
mod tests {
use super::*;
use minidom::Element;
- use try_from::TryFrom;
+ use std::convert::TryFrom;
#[cfg(target_pointer_width = "32")]
#[test]
@@ -9,7 +9,7 @@ use crate::ns;
use jid::Jid;
use minidom::Element;
use std::net::IpAddr;
-use try_from::TryFrom;
+use std::convert::TryFrom;
generate_attribute!(
/// The type of the connection being proposed by this candidate.
@@ -172,7 +172,7 @@ impl Transport {
}
impl TryFrom<Element> for Transport {
- type Err = Error;
+ type Error = Error;
fn try_from(elem: Element) -> Result<Transport, Error> {
check_self!(elem, "transport", JINGLE_S5B);
@@ -26,7 +26,7 @@
pub use minidom::Element;
pub use jid::{Jid, JidParseError};
-pub use try_from::{TryFrom, TryInto};
+pub use std::convert::{TryFrom, TryInto};
pub use crate::util::error::Error;
/// XML namespace definitions used through XMPP.
@@ -14,7 +14,7 @@ use crate::pubsub::NodeName;
use crate::rsm::{SetQuery, SetResult};
use jid::Jid;
use minidom::Element;
-use try_from::TryFrom;
+use std::convert::TryFrom;
generate_id!(
/// An identifier matching a result message to the query requesting it.
@@ -126,7 +126,7 @@ impl IqSetPayload for Prefs {}
impl IqResultPayload for Prefs {}
impl TryFrom<Element> for Prefs {
- type Err = Error;
+ type Error = Error;
fn try_from(elem: Element) -> Result<Prefs, Error> {
check_self!(elem, "prefs", MAM);
@@ -49,7 +49,7 @@ mod tests {
use crate::util::error::Error;
use minidom::Element;
use std::error::Error as StdError;
- use try_from::TryFrom;
+ use std::convert::TryFrom;
#[cfg(target_pointer_width = "32")]
#[test]
@@ -9,7 +9,7 @@ use crate::ns;
use jid::Jid;
use minidom::Element;
use std::collections::BTreeMap;
-use try_from::TryFrom;
+use std::convert::TryFrom;
/// Should be implemented on every known payload of a `<message/>`.
pub trait MessagePayload: TryFrom<Element> + Into<Element> {}
@@ -150,7 +150,7 @@ impl Message {
}
impl TryFrom<Element> for Message {
- type Err = Error;
+ type Error = Error;
fn try_from(root: Element) -> Result<Message, Error> {
check_self!(root, "message", DEFAULT_NS);
@@ -23,7 +23,7 @@ mod tests {
use super::*;
use crate::util::error::Error;
use minidom::Element;
- use try_from::TryFrom;
+ use std::convert::TryFrom;
#[cfg(target_pointer_width = "32")]
#[test]
@@ -272,7 +272,7 @@ generate_elem_id!(
mod tests {
use super::*;
use minidom::Element;
- use try_from::TryFrom;
+ use std::convert::TryFrom;
#[cfg(target_pointer_width = "32")]
#[test]
@@ -98,7 +98,7 @@ mod tests {
use crate::util::error::Error;
use minidom::Element;
use std::str::FromStr;
- use try_from::TryFrom;
+ use std::convert::TryFrom;
#[test]
fn test_muc_simple() {
@@ -9,7 +9,7 @@ use crate::util::error::Error;
use crate::ns;
use jid::Jid;
use minidom::Element;
-use try_from::TryFrom;
+use std::convert::TryFrom;
generate_attribute_enum!(
/// Lists all of the possible status codes used in MUC presences.
@@ -89,7 +89,7 @@ pub enum Actor {
}
impl TryFrom<Element> for Actor {
- type Err = Error;
+ type Error = Error;
fn try_from(elem: Element) -> Result<Actor, Error> {
check_self!(elem, "actor", MUC_USER);
@@ -17,7 +17,7 @@ mod tests {
#[cfg(not(feature = "disable-validation"))]
use crate::util::error::Error;
use minidom::Element;
- use try_from::TryFrom;
+ use std::convert::TryFrom;
#[cfg(target_pointer_width = "32")]
#[test]
@@ -23,7 +23,7 @@ mod tests {
#[cfg(not(feature = "disable-validation"))]
use crate::util::error::Error;
use minidom::Element;
- use try_from::TryFrom;
+ use std::convert::TryFrom;
#[test]
fn test_size() {
@@ -11,7 +11,7 @@ use jid::Jid;
use minidom::{Element, ElementEmitter, IntoAttributeValue, IntoElements};
use std::collections::BTreeMap;
use std::str::FromStr;
-use try_from::TryFrom;
+use std::convert::TryFrom;
/// Should be implemented on every known payload of a `<presence/>`.
pub trait PresencePayload: TryFrom<Element> + Into<Element> {}
@@ -259,7 +259,7 @@ impl Presence {
}
impl TryFrom<Element> for Presence {
- type Err = Error;
+ type Error = Error;
fn try_from(root: Element) -> Result<Presence, Error> {
check_self!(root, "presence", DEFAULT_NS);
@@ -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);
@@ -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);
@@ -33,7 +33,7 @@ mod tests {
use super::*;
use crate::ns;
use minidom::Element;
- use try_from::TryFrom;
+ use std::convert::TryFrom;
#[cfg(target_pointer_width = "32")]
#[test]
@@ -96,7 +96,7 @@ mod tests {
use crate::util::error::Error;
use minidom::Element;
use std::str::FromStr;
- use try_from::TryFrom;
+ use std::convert::TryFrom;
#[cfg(target_pointer_width = "32")]
#[test]
@@ -7,7 +7,7 @@
use crate::util::error::Error;
use crate::ns;
use minidom::Element;
-use try_from::TryFrom;
+use std::convert::TryFrom;
/// Requests paging through a potentially big set of items (represented by an
/// UID).
@@ -29,7 +29,7 @@ pub struct SetQuery {
}
impl TryFrom<Element> for SetQuery {
- type Err = Error;
+ type Error = Error;
fn try_from(elem: Element) -> Result<SetQuery, Error> {
check_self!(elem, "set", RSM, "RSM set");
@@ -116,7 +116,7 @@ pub struct SetResult {
}
impl TryFrom<Element> for SetResult {
- type Err = Error;
+ type Error = Error;
fn try_from(elem: Element) -> Result<SetResult, Error> {
check_self!(elem, "set", RSM, "RSM set");
@@ -9,7 +9,7 @@ use crate::util::helpers::Base64;
use crate::ns;
use minidom::Element;
use std::collections::BTreeMap;
-use try_from::TryFrom;
+use std::convert::TryFrom;
generate_attribute!(
/// The list of available SASL mechanisms.
@@ -151,7 +151,7 @@ pub struct Failure {
}
impl TryFrom<Element> for Failure {
- type Err = Error;
+ type Error = Error;
fn try_from(root: Element) -> Result<Failure, Error> {
check_self!(root, "failure", SASL);
@@ -224,7 +224,7 @@ impl From<Failure> for Element {
mod tests {
use super::*;
use minidom::Element;
- use try_from::TryFrom;
+ use std::convert::TryFrom;
#[cfg(target_pointer_width = "32")]
#[test]
@@ -6,7 +6,7 @@
use crate::data_forms::{DataForm, DataFormType, Field, FieldType};
use crate::ns;
use crate::util::error::Error;
-use try_from::TryFrom;
+use std::convert::TryFrom;
/// Structure representing a `http://jabber.org/network/serverinfo` form type.
#[derive(Debug, Clone, PartialEq, Default)]
@@ -31,7 +31,7 @@ pub struct ServerInfo {
}
impl TryFrom<DataForm> for ServerInfo {
- type Err = Error;
+ type Error = Error;
fn try_from(form: DataForm) -> Result<ServerInfo, Error> {
if form.type_ != DataFormType::Result_ {
@@ -146,7 +146,7 @@ generate_empty_element!(
mod tests {
use super::*;
use minidom::Element;
- use try_from::TryFrom;
+ use std::convert::TryFrom;
#[cfg(target_pointer_width = "32")]
#[test]
@@ -11,7 +11,7 @@ use crate::presence::PresencePayload;
use jid::Jid;
use minidom::Element;
use std::collections::BTreeMap;
-use try_from::TryFrom;
+use std::convert::TryFrom;
generate_attribute!(
/// The type of the error.
@@ -236,7 +236,7 @@ impl StanzaError {
}
impl TryFrom<Element> for StanzaError {
- type Err = Error;
+ type Error = Error;
fn try_from(elem: Element) -> Result<StanzaError, Error> {
check_self!(elem, "error", DEFAULT_NS);
@@ -40,7 +40,7 @@ mod tests {
use crate::util::error::Error;
use minidom::Element;
use std::str::FromStr;
- use try_from::TryFrom;
+ use std::convert::TryFrom;
#[cfg(target_pointer_width = "32")]
#[test]
@@ -74,7 +74,7 @@ impl Stream {
mod tests {
use super::*;
use minidom::Element;
- use try_from::TryFrom;
+ use std::convert::TryFrom;
#[cfg(target_pointer_width = "32")]
#[test]
@@ -230,8 +230,8 @@ macro_rules! generate_element_enum {
$enum
),+
}
- impl ::try_from::TryFrom<::minidom::Element> for $elem {
- type Err = crate::util::error::Error;
+ impl ::std::convert::TryFrom<::minidom::Element> for $elem {
+ type Error = crate::util::error::Error;
fn try_from(elem: ::minidom::Element) -> Result<$elem, crate::util::error::Error> {
check_ns_only!(elem, $name, $ns);
check_no_children!(elem, $name);
@@ -269,8 +269,8 @@ macro_rules! generate_attribute_enum {
$enum
),+
}
- impl ::try_from::TryFrom<::minidom::Element> for $elem {
- type Err = crate::util::error::Error;
+ impl ::std::convert::TryFrom<::minidom::Element> for $elem {
+ type Error = crate::util::error::Error;
fn try_from(elem: ::minidom::Element) -> Result<$elem, crate::util::error::Error> {
check_ns_only!(elem, $name, $ns);
check_no_children!(elem, $name);
@@ -367,8 +367,8 @@ macro_rules! generate_empty_element {
#[derive(Debug, Clone)]
pub struct $elem;
- impl ::try_from::TryFrom<::minidom::Element> for $elem {
- type Err = crate::util::error::Error;
+ impl ::std::convert::TryFrom<::minidom::Element> for $elem {
+ type Error = crate::util::error::Error;
fn try_from(elem: ::minidom::Element) -> Result<$elem, crate::util::error::Error> {
check_self!(elem, $name, $ns);
@@ -420,8 +420,8 @@ macro_rules! generate_elem_id {
Ok($elem(String::from(s)))
}
}
- impl ::try_from::TryFrom<::minidom::Element> for $elem {
- type Err = crate::util::error::Error;
+ impl ::std::convert::TryFrom<::minidom::Element> for $elem {
+ type Error = crate::util::error::Error;
fn try_from(elem: ::minidom::Element) -> Result<$elem, crate::util::error::Error> {
check_self!(elem, $name, $ns);
check_no_children!(elem, $name);
@@ -600,8 +600,8 @@ macro_rules! generate_element {
)*
}
- impl ::try_from::TryFrom<::minidom::Element> for $elem {
- type Err = crate::util::error::Error;
+ impl ::std::convert::TryFrom<::minidom::Element> for $elem {
+ type Error = crate::util::error::Error;
fn try_from(elem: ::minidom::Element) -> Result<$elem, crate::util::error::Error> {
check_self!(elem, $name, $ns);
@@ -662,7 +662,7 @@ macro_rules! assert_size (
macro_rules! impl_pubsub_item {
($item:ident, $ns:ident) => {
impl crate::TryFrom<crate::Element> for $item {
- type Err = Error;
+ type Error = Error;
fn try_from(elem: crate::Element) -> Result<$item, Error> {
check_self!(elem, "item", $ns);
@@ -43,7 +43,7 @@ mod tests {
use super::*;
use crate::util::compare_elements::NamespaceAwareCompare;
use minidom::Element;
- use try_from::TryFrom;
+ use std::convert::TryFrom;
#[cfg(target_pointer_width = "32")]
#[test]
@@ -73,7 +73,7 @@ impl Open {
mod tests {
use super::*;
use minidom::Element;
- use try_from::TryFrom;
+ use std::convert::TryFrom;
#[cfg(target_pointer_width = "32")]
#[test]