From 4089891f6c96bb025de8c9a77b2e58b568534a74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Sat, 11 Nov 2023 14:52:55 +0100 Subject: [PATCH] Update edition to 2021 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove TryFrom/Into and FromIterator imports - Prevent impl_validator_using_provider macro in sasl crate from constructing trait object Signed-off-by: Maxime “pep” Buquet --- Cargo.toml | 1 + jid/Cargo.toml | 2 +- jid/src/lib.rs | 1 - minidom/Cargo.toml | 2 +- minidom/src/element.rs | 3 --- minidom/src/node.rs | 1 - parsers/Cargo.toml | 2 +- parsers/examples/generate-caps.rs | 1 - parsers/src/attention.rs | 1 - parsers/src/avatar.rs | 1 - parsers/src/bind.rs | 1 - parsers/src/blocking.rs | 1 - parsers/src/bob.rs | 1 - parsers/src/bookmarks.rs | 1 - parsers/src/bookmarks2.rs | 2 -- parsers/src/caps.rs | 1 - parsers/src/carbons.rs | 1 - parsers/src/cert_management.rs | 1 - parsers/src/chatstates.rs | 1 - parsers/src/component.rs | 1 - parsers/src/csi.rs | 1 - parsers/src/data_forms.rs | 1 - parsers/src/delay.rs | 1 - parsers/src/disco.rs | 1 - parsers/src/ecaps2.rs | 1 - parsers/src/eme.rs | 1 - parsers/src/extdisco.rs | 1 - parsers/src/forwarding.rs | 1 - parsers/src/hashes.rs | 1 - parsers/src/http_upload.rs | 3 --- parsers/src/ibb.rs | 1 - parsers/src/ibr.rs | 1 - parsers/src/idle.rs | 1 - parsers/src/iq.rs | 1 - parsers/src/jid_prep.rs | 1 - parsers/src/jingle.rs | 1 - parsers/src/jingle_dtls_srtp.rs | 1 - parsers/src/jingle_ft.rs | 1 - parsers/src/jingle_grouping.rs | 1 - parsers/src/jingle_ibb.rs | 1 - parsers/src/jingle_ice_udp.rs | 1 - parsers/src/jingle_message.rs | 1 - parsers/src/jingle_raw_udp.rs | 1 - parsers/src/jingle_rtcp_fb.rs | 1 - parsers/src/jingle_rtp.rs | 1 - parsers/src/jingle_rtp_hdrext.rs | 1 - parsers/src/jingle_s5b.rs | 1 - parsers/src/jingle_ssma.rs | 1 - parsers/src/legacy_omemo.rs | 1 - parsers/src/mam.rs | 1 - parsers/src/mam_prefs.rs | 1 - parsers/src/media_element.rs | 1 - parsers/src/message.rs | 1 - parsers/src/message_correct.rs | 1 - parsers/src/mix.rs | 1 - parsers/src/mood.rs | 1 - parsers/src/muc/muc.rs | 1 - parsers/src/muc/user.rs | 1 - parsers/src/nick.rs | 1 - parsers/src/occupant_id.rs | 1 - parsers/src/ping.rs | 1 - parsers/src/presence.rs | 1 - parsers/src/pubsub/event.rs | 1 - parsers/src/pubsub/owner.rs | 1 - parsers/src/pubsub/pubsub.rs | 1 - parsers/src/receipts.rs | 1 - parsers/src/roster.rs | 1 - parsers/src/rsm.rs | 1 - parsers/src/rtt.rs | 2 -- parsers/src/sasl.rs | 2 -- parsers/src/server_info.rs | 1 - parsers/src/sm.rs | 1 - parsers/src/stanza_error.rs | 1 - parsers/src/stanza_id.rs | 1 - parsers/src/stream.rs | 1 - parsers/src/time.rs | 1 - parsers/src/tune.rs | 1 - parsers/src/version.rs | 1 - parsers/src/websocket.rs | 1 - parsers/src/xhtml.rs | 1 - sasl/Cargo.toml | 2 +- sasl/src/server/mod.rs | 2 +- tokio-xmpp/Cargo.toml | 2 +- tokio-xmpp/examples/contact_addr.rs | 1 - tokio-xmpp/examples/download_avatars.rs | 1 - tokio-xmpp/examples/echo_bot.rs | 1 - tokio-xmpp/examples/echo_component.rs | 1 - tokio-xmpp/src/client/auth.rs | 1 - tokio-xmpp/src/client/bind.rs | 1 - tokio-xmpp/src/starttls.rs | 1 - xmpp/Cargo.toml | 2 +- xmpp/src/lib.rs | 1 - xmpp/src/pubsub/avatar.rs | 1 - xmpp/src/pubsub/mod.rs | 1 - 94 files changed, 8 insertions(+), 100 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index f3b55c0..80a8a02 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,6 +7,7 @@ members = [ # alphabetically sorted "tokio-xmpp", "xmpp", ] +resolver = "2" [patch.crates-io] jid = { path = "jid" } diff --git a/jid/Cargo.toml b/jid/Cargo.toml index 4e77353..df12387 100644 --- a/jid/Cargo.toml +++ b/jid/Cargo.toml @@ -13,7 +13,7 @@ documentation = "https://docs.rs/jid" readme = "README.md" keywords = ["xmpp", "jid"] license = "MPL-2.0" -edition = "2018" +edition = "2021" [badges] gitlab = { repository = "xmpp-rs/xmpp-rs" } diff --git a/jid/src/lib.rs b/jid/src/lib.rs index 6f746a2..ada5938 100644 --- a/jid/src/lib.rs +++ b/jid/src/lib.rs @@ -31,7 +31,6 @@ //! mixing left-to-write and right-to-left characters use core::num::NonZeroU16; -use std::convert::TryFrom; use std::fmt; use std::str::FromStr; diff --git a/minidom/Cargo.toml b/minidom/Cargo.toml index b31f099..4e8f3fb 100644 --- a/minidom/Cargo.toml +++ b/minidom/Cargo.toml @@ -15,7 +15,7 @@ documentation = "https://docs.rs/minidom" readme = "README.md" keywords = ["xml", "xmpp"] license = "MPL-2.0" -edition = "2018" +edition = "2021" [badges] gitlab = { repository = "xmpp-rs/xmpp-rs" } diff --git a/minidom/src/element.rs b/minidom/src/element.rs index f1d1bba..996f600 100644 --- a/minidom/src/element.rs +++ b/minidom/src/element.rs @@ -20,7 +20,6 @@ use crate::prefixes::{Namespace, Prefix, Prefixes}; use crate::tree_builder::TreeBuilder; use std::collections::{btree_map, BTreeMap}; -use std::convert::{TryFrom, TryInto}; use std::io::{BufRead, Write}; use std::sync::Arc; @@ -884,8 +883,6 @@ mod tests { #[test] fn test_element_new() { - use std::iter::FromIterator; - let elem = Element::new( "name".to_owned(), "namespace".to_owned(), diff --git a/minidom/src/node.rs b/minidom/src/node.rs index b7f2231..7486466 100644 --- a/minidom/src/node.rs +++ b/minidom/src/node.rs @@ -13,7 +13,6 @@ use crate::error::Result; use rxml::writer::Item; -use std::convert::TryInto; use std::io::Write; /// A node in an element tree. diff --git a/parsers/Cargo.toml b/parsers/Cargo.toml index 5439371..b4352f9 100644 --- a/parsers/Cargo.toml +++ b/parsers/Cargo.toml @@ -11,7 +11,7 @@ repository = "https://gitlab.com/xmpp-rs/xmpp-rs" keywords = ["xmpp", "jabber", "xml"] categories = ["parsing", "network-programming"] license = "MPL-2.0" -edition = "2018" +edition = "2021" [dependencies] minidom = "0.15" diff --git a/parsers/examples/generate-caps.rs b/parsers/examples/generate-caps.rs index a36963a..9c06169 100644 --- a/parsers/examples/generate-caps.rs +++ b/parsers/examples/generate-caps.rs @@ -4,7 +4,6 @@ // 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::env; use std::io::{self, Read}; use xmpp_parsers::{ diff --git a/parsers/src/attention.rs b/parsers/src/attention.rs index 83a871c..8e7577a 100644 --- a/parsers/src/attention.rs +++ b/parsers/src/attention.rs @@ -21,7 +21,6 @@ mod tests { #[cfg(not(feature = "disable-validation"))] use crate::util::error::Error; use crate::Element; - use std::convert::TryFrom; #[test] fn test_size() { diff --git a/parsers/src/avatar.rs b/parsers/src/avatar.rs index 0c1eecc..1a334a1 100644 --- a/parsers/src/avatar.rs +++ b/parsers/src/avatar.rs @@ -61,7 +61,6 @@ mod tests { #[cfg(not(feature = "disable-validation"))] use crate::util::error::Error; use crate::Element; - use std::convert::TryFrom; #[cfg(target_pointer_width = "32")] #[test] diff --git a/parsers/src/bind.rs b/parsers/src/bind.rs index dc75307..6d02b56 100644 --- a/parsers/src/bind.rs +++ b/parsers/src/bind.rs @@ -9,7 +9,6 @@ use crate::ns; use crate::util::error::Error; use crate::Element; use jid::{FullJid, Jid}; -use std::convert::TryFrom; use std::str::FromStr; /// The request for resource binding, which is the process by which a client diff --git a/parsers/src/blocking.rs b/parsers/src/blocking.rs index 7d1fad0..464b139 100644 --- a/parsers/src/blocking.rs +++ b/parsers/src/blocking.rs @@ -9,7 +9,6 @@ use crate::ns; use crate::util::error::Error; use crate::Element; use jid::Jid; -use std::convert::TryFrom; generate_empty_element!( /// The element requesting the blocklist, the result iq will contain a diff --git a/parsers/src/bob.rs b/parsers/src/bob.rs index dd18e25..8e34ef4 100644 --- a/parsers/src/bob.rs +++ b/parsers/src/bob.rs @@ -89,7 +89,6 @@ generate_element!( mod tests { use super::*; use crate::Element; - use std::convert::TryFrom; #[cfg(target_pointer_width = "32")] #[test] diff --git a/parsers/src/bookmarks.rs b/parsers/src/bookmarks.rs index 9ed2433..1f68ce5 100644 --- a/parsers/src/bookmarks.rs +++ b/parsers/src/bookmarks.rs @@ -71,7 +71,6 @@ impl Storage { mod tests { use super::*; use crate::Element; - use std::convert::TryFrom; #[cfg(target_pointer_width = "32")] #[test] diff --git a/parsers/src/bookmarks2.rs b/parsers/src/bookmarks2.rs index 1a6d079..16ca307 100644 --- a/parsers/src/bookmarks2.rs +++ b/parsers/src/bookmarks2.rs @@ -6,7 +6,6 @@ use crate::ns; use crate::util::error::Error; use crate::Element; -use std::convert::TryFrom; generate_attribute!( /// Whether a conference bookmark should be joined automatically. @@ -123,7 +122,6 @@ mod tests { use super::*; use crate::pubsub::{pubsub::Item as PubSubItem, PubSubEvent}; use crate::Element; - use std::convert::TryFrom; #[cfg(target_pointer_width = "32")] #[test] diff --git a/parsers/src/caps.rs b/parsers/src/caps.rs index 673d00a..d3990b4 100644 --- a/parsers/src/caps.rs +++ b/parsers/src/caps.rs @@ -17,7 +17,6 @@ use digest::{Digest, Update, VariableOutput}; use sha1::Sha1; use sha2::{Sha256, Sha512}; use sha3::{Sha3_256, Sha3_512}; -use std::convert::TryFrom; /// Represents a capability hash for a given client. #[derive(Debug, Clone)] diff --git a/parsers/src/carbons.rs b/parsers/src/carbons.rs index 010830f..f528354 100644 --- a/parsers/src/carbons.rs +++ b/parsers/src/carbons.rs @@ -64,7 +64,6 @@ impl MessagePayload for Sent {} mod tests { use super::*; use crate::Element; - use std::convert::TryFrom; #[cfg(target_pointer_width = "32")] #[test] diff --git a/parsers/src/cert_management.rs b/parsers/src/cert_management.rs index 0d7ed2f..c53e774 100644 --- a/parsers/src/cert_management.rs +++ b/parsers/src/cert_management.rs @@ -121,7 +121,6 @@ mod tests { use super::*; use crate::ns; use crate::Element; - use std::convert::TryFrom; use std::str::FromStr; #[cfg(target_pointer_width = "32")] diff --git a/parsers/src/chatstates.rs b/parsers/src/chatstates.rs index 5e98112..e9c83a0 100644 --- a/parsers/src/chatstates.rs +++ b/parsers/src/chatstates.rs @@ -35,7 +35,6 @@ mod tests { use crate::ns; use crate::util::error::Error; use crate::Element; - use std::convert::TryFrom; #[test] fn test_size() { diff --git a/parsers/src/component.rs b/parsers/src/component.rs index b8120ff..c732933 100644 --- a/parsers/src/component.rs +++ b/parsers/src/component.rs @@ -44,7 +44,6 @@ impl Handshake { mod tests { use super::*; use crate::Element; - use std::convert::TryFrom; #[cfg(target_pointer_width = "32")] #[test] diff --git a/parsers/src/csi.rs b/parsers/src/csi.rs index bfd44f8..3d26463 100644 --- a/parsers/src/csi.rs +++ b/parsers/src/csi.rs @@ -30,7 +30,6 @@ mod tests { use super::*; use crate::ns; use crate::Element; - use std::convert::TryFrom; #[test] fn test_size() { diff --git a/parsers/src/data_forms.rs b/parsers/src/data_forms.rs index e1eb473..6e7572e 100644 --- a/parsers/src/data_forms.rs +++ b/parsers/src/data_forms.rs @@ -8,7 +8,6 @@ use crate::media_element::MediaElement; use crate::ns; use crate::util::error::Error; use crate::Element; -use std::convert::TryFrom; generate_element!( /// Represents one of the possible values for a list- field. diff --git a/parsers/src/delay.rs b/parsers/src/delay.rs index dcaad9f..028ce57 100644 --- a/parsers/src/delay.rs +++ b/parsers/src/delay.rs @@ -35,7 +35,6 @@ mod tests { use crate::util::error::Error; use crate::Element; use jid::BareJid; - use std::convert::TryFrom; use std::str::FromStr; #[cfg(target_pointer_width = "32")] diff --git a/parsers/src/disco.rs b/parsers/src/disco.rs index 8eff50b..1d7a7ff 100644 --- a/parsers/src/disco.rs +++ b/parsers/src/disco.rs @@ -10,7 +10,6 @@ use crate::ns; use crate::util::error::Error; use crate::Element; use jid::Jid; -use std::convert::TryFrom; generate_element!( /// Structure representing a `` element. diff --git a/parsers/src/ecaps2.rs b/parsers/src/ecaps2.rs index 107b0f8..873c615 100644 --- a/parsers/src/ecaps2.rs +++ b/parsers/src/ecaps2.rs @@ -185,7 +185,6 @@ mod tests { use super::*; use crate::util::error::Error; use crate::Element; - use std::convert::TryFrom; #[cfg(target_pointer_width = "32")] #[test] diff --git a/parsers/src/eme.rs b/parsers/src/eme.rs index 1014318..5a624a3 100644 --- a/parsers/src/eme.rs +++ b/parsers/src/eme.rs @@ -26,7 +26,6 @@ mod tests { use super::*; use crate::util::error::Error; use crate::Element; - use std::convert::TryFrom; #[cfg(target_pointer_width = "32")] #[test] diff --git a/parsers/src/extdisco.rs b/parsers/src/extdisco.rs index c95e653..ded6312 100644 --- a/parsers/src/extdisco.rs +++ b/parsers/src/extdisco.rs @@ -141,7 +141,6 @@ mod tests { use super::*; use crate::ns; use crate::Element; - use std::convert::TryFrom; #[cfg(target_pointer_width = "32")] #[test] diff --git a/parsers/src/forwarding.rs b/parsers/src/forwarding.rs index 75008ea..28984fa 100644 --- a/parsers/src/forwarding.rs +++ b/parsers/src/forwarding.rs @@ -28,7 +28,6 @@ mod tests { use super::*; use crate::util::error::Error; use crate::Element; - use std::convert::TryFrom; #[cfg(target_pointer_width = "32")] #[test] diff --git a/parsers/src/hashes.rs b/parsers/src/hashes.rs index f4b3a9c..a1e0cef 100644 --- a/parsers/src/hashes.rs +++ b/parsers/src/hashes.rs @@ -205,7 +205,6 @@ impl Deref for Sha1HexAttribute { mod tests { use super::*; use crate::Element; - use std::convert::TryFrom; #[cfg(target_pointer_width = "32")] #[test] diff --git a/parsers/src/http_upload.rs b/parsers/src/http_upload.rs index 39815ab..84b3cc6 100644 --- a/parsers/src/http_upload.rs +++ b/parsers/src/http_upload.rs @@ -4,8 +4,6 @@ // 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 crate::iq::{IqGetPayload, IqResultPayload}; use crate::ns; use crate::util::error::Error; @@ -117,7 +115,6 @@ impl IqResultPayload for SlotResult {} mod tests { use super::*; use crate::Element; - use std::convert::TryFrom; #[test] fn test_slot_request() { diff --git a/parsers/src/ibb.rs b/parsers/src/ibb.rs index 3e4ab57..32f9f08 100644 --- a/parsers/src/ibb.rs +++ b/parsers/src/ibb.rs @@ -74,7 +74,6 @@ mod tests { use super::*; use crate::util::error::Error; use crate::Element; - use std::convert::TryFrom; #[cfg(target_pointer_width = "32")] #[test] diff --git a/parsers/src/ibr.rs b/parsers/src/ibr.rs index 71ce324..13b25b1 100644 --- a/parsers/src/ibr.rs +++ b/parsers/src/ibr.rs @@ -10,7 +10,6 @@ use crate::ns; use crate::util::error::Error; use crate::Element; use std::collections::HashMap; -use std::convert::TryFrom; /// Query for registering against a service. #[derive(Debug, Clone)] diff --git a/parsers/src/idle.rs b/parsers/src/idle.rs index a575b32..c5ea025 100644 --- a/parsers/src/idle.rs +++ b/parsers/src/idle.rs @@ -23,7 +23,6 @@ mod tests { use super::*; use crate::util::error::Error; use crate::Element; - use std::convert::TryFrom; use std::str::FromStr; #[test] diff --git a/parsers/src/iq.rs b/parsers/src/iq.rs index b725a8f..2d4451d 100644 --- a/parsers/src/iq.rs +++ b/parsers/src/iq.rs @@ -11,7 +11,6 @@ use crate::util::error::Error; use crate::Element; use jid::Jid; use minidom::IntoAttributeValue; -use std::convert::TryFrom; /// Should be implemented on every known payload of an ``. pub trait IqGetPayload: TryFrom + Into {} diff --git a/parsers/src/jid_prep.rs b/parsers/src/jid_prep.rs index 7468363..a6f0f80 100644 --- a/parsers/src/jid_prep.rs +++ b/parsers/src/jid_prep.rs @@ -42,7 +42,6 @@ mod tests { use super::*; use crate::Element; use jid::FullJid; - use std::convert::TryFrom; #[cfg(target_pointer_width = "32")] #[test] diff --git a/parsers/src/jingle.rs b/parsers/src/jingle.rs index e97cd66..bddc3c5 100644 --- a/parsers/src/jingle.rs +++ b/parsers/src/jingle.rs @@ -15,7 +15,6 @@ use crate::util::error::Error; use crate::Element; use jid::Jid; use std::collections::BTreeMap; -use std::convert::TryFrom; use std::fmt; use std::str::FromStr; diff --git a/parsers/src/jingle_dtls_srtp.rs b/parsers/src/jingle_dtls_srtp.rs index a586946..21d193a 100644 --- a/parsers/src/jingle_dtls_srtp.rs +++ b/parsers/src/jingle_dtls_srtp.rs @@ -73,7 +73,6 @@ impl Fingerprint { mod tests { use super::*; use crate::Element; - use std::convert::TryFrom; #[cfg(target_pointer_width = "32")] #[test] diff --git a/parsers/src/jingle_ft.rs b/parsers/src/jingle_ft.rs index 270a1f1..67c7a98 100644 --- a/parsers/src/jingle_ft.rs +++ b/parsers/src/jingle_ft.rs @@ -11,7 +11,6 @@ use crate::ns; use crate::util::error::Error; use minidom::{Element, Node}; use std::collections::BTreeMap; -use std::convert::TryFrom; use std::str::FromStr; generate_element!( diff --git a/parsers/src/jingle_grouping.rs b/parsers/src/jingle_grouping.rs index cda993c..b3fc339 100644 --- a/parsers/src/jingle_grouping.rs +++ b/parsers/src/jingle_grouping.rs @@ -52,7 +52,6 @@ generate_element!( mod tests { use super::*; use crate::Element; - use std::convert::TryFrom; #[cfg(target_pointer_width = "32")] #[test] diff --git a/parsers/src/jingle_ibb.rs b/parsers/src/jingle_ibb.rs index 3018842..e368090 100644 --- a/parsers/src/jingle_ibb.rs +++ b/parsers/src/jingle_ibb.rs @@ -26,7 +26,6 @@ mod tests { use super::*; use crate::util::error::Error; use crate::Element; - use std::convert::TryFrom; #[cfg(target_pointer_width = "32")] #[test] diff --git a/parsers/src/jingle_ice_udp.rs b/parsers/src/jingle_ice_udp.rs index a9907ad..f464288 100644 --- a/parsers/src/jingle_ice_udp.rs +++ b/parsers/src/jingle_ice_udp.rs @@ -114,7 +114,6 @@ mod tests { use crate::hashes::Algo; use crate::jingle_dtls_srtp::Setup; use crate::Element; - use std::convert::TryFrom; #[cfg(target_pointer_width = "32")] #[test] diff --git a/parsers/src/jingle_message.rs b/parsers/src/jingle_message.rs index 69221e7..c32da47 100644 --- a/parsers/src/jingle_message.rs +++ b/parsers/src/jingle_message.rs @@ -8,7 +8,6 @@ use crate::jingle::SessionId; use crate::ns; use crate::util::error::Error; use crate::Element; -use std::convert::TryFrom; /// Defines a protocol for broadcasting Jingle requests to all of the clients /// of a user. diff --git a/parsers/src/jingle_raw_udp.rs b/parsers/src/jingle_raw_udp.rs index bf3c4b1..3063dca 100644 --- a/parsers/src/jingle_raw_udp.rs +++ b/parsers/src/jingle_raw_udp.rs @@ -60,7 +60,6 @@ generate_element!( mod tests { use super::*; use crate::Element; - use std::convert::TryFrom; #[cfg(target_pointer_width = "32")] #[test] diff --git a/parsers/src/jingle_rtcp_fb.rs b/parsers/src/jingle_rtcp_fb.rs index d02a589..ee64aee 100644 --- a/parsers/src/jingle_rtcp_fb.rs +++ b/parsers/src/jingle_rtcp_fb.rs @@ -20,7 +20,6 @@ generate_element!( mod tests { use super::*; use crate::Element; - use std::convert::TryFrom; #[cfg(target_pointer_width = "32")] #[test] diff --git a/parsers/src/jingle_rtp.rs b/parsers/src/jingle_rtp.rs index d0566d7..ef3ae62 100644 --- a/parsers/src/jingle_rtp.rs +++ b/parsers/src/jingle_rtp.rs @@ -153,7 +153,6 @@ generate_element!( mod tests { use super::*; use crate::Element; - use std::convert::TryFrom; #[cfg(target_pointer_width = "32")] #[test] diff --git a/parsers/src/jingle_rtp_hdrext.rs b/parsers/src/jingle_rtp_hdrext.rs index 7aceca5..2f8ba07 100644 --- a/parsers/src/jingle_rtp_hdrext.rs +++ b/parsers/src/jingle_rtp_hdrext.rs @@ -56,7 +56,6 @@ impl RtpHdrext { mod tests { use super::*; use crate::Element; - use std::convert::TryFrom; #[cfg(target_pointer_width = "32")] #[test] diff --git a/parsers/src/jingle_s5b.rs b/parsers/src/jingle_s5b.rs index 2a5ba02..a8db30b 100644 --- a/parsers/src/jingle_s5b.rs +++ b/parsers/src/jingle_s5b.rs @@ -8,7 +8,6 @@ use crate::ns; use crate::util::error::Error; use crate::Element; use jid::Jid; -use std::convert::TryFrom; use std::net::IpAddr; generate_attribute!( diff --git a/parsers/src/jingle_ssma.rs b/parsers/src/jingle_ssma.rs index a67f71d..2ca6f71 100644 --- a/parsers/src/jingle_ssma.rs +++ b/parsers/src/jingle_ssma.rs @@ -79,7 +79,6 @@ generate_element!( mod tests { use super::*; use crate::Element; - use std::convert::TryFrom; #[cfg(target_pointer_width = "32")] #[test] diff --git a/parsers/src/legacy_omemo.rs b/parsers/src/legacy_omemo.rs index ae7ace0..cf96914 100644 --- a/parsers/src/legacy_omemo.rs +++ b/parsers/src/legacy_omemo.rs @@ -182,7 +182,6 @@ impl MessagePayload for Encrypted {} mod tests { use super::*; use crate::Element; - use std::convert::TryInto; #[test] fn parse_bundle() { diff --git a/parsers/src/mam.rs b/parsers/src/mam.rs index 42c541c..f8839fe 100644 --- a/parsers/src/mam.rs +++ b/parsers/src/mam.rs @@ -92,7 +92,6 @@ mod tests { use super::*; use crate::util::error::Error; use minidom::Element; - use std::convert::TryFrom; #[cfg(target_pointer_width = "32")] #[test] diff --git a/parsers/src/mam_prefs.rs b/parsers/src/mam_prefs.rs index 589809e..52a9902 100644 --- a/parsers/src/mam_prefs.rs +++ b/parsers/src/mam_prefs.rs @@ -9,7 +9,6 @@ use crate::ns; use crate::util::error::Error; use jid::Jid; use minidom::{Element, Node}; -use std::convert::TryFrom; generate_attribute!( /// Notes the default archiving preference for the user. diff --git a/parsers/src/media_element.rs b/parsers/src/media_element.rs index 536c0dd..cfe3250 100644 --- a/parsers/src/media_element.rs +++ b/parsers/src/media_element.rs @@ -48,7 +48,6 @@ mod tests { use crate::data_forms::DataForm; use crate::util::error::Error; use crate::Element; - use std::convert::TryFrom; #[cfg(target_pointer_width = "32")] #[test] diff --git a/parsers/src/message.rs b/parsers/src/message.rs index 4a34c06..50fe421 100644 --- a/parsers/src/message.rs +++ b/parsers/src/message.rs @@ -9,7 +9,6 @@ use crate::util::error::Error; use crate::Element; use jid::Jid; use std::collections::BTreeMap; -use std::convert::TryFrom; /// Should be implemented on every known payload of a ``. pub trait MessagePayload: TryFrom + Into {} diff --git a/parsers/src/message_correct.rs b/parsers/src/message_correct.rs index 374900f..2291ede 100644 --- a/parsers/src/message_correct.rs +++ b/parsers/src/message_correct.rs @@ -23,7 +23,6 @@ mod tests { use super::*; use crate::util::error::Error; use crate::Element; - use std::convert::TryFrom; #[cfg(target_pointer_width = "32")] #[test] diff --git a/parsers/src/mix.rs b/parsers/src/mix.rs index 135a650..e6e30bb 100644 --- a/parsers/src/mix.rs +++ b/parsers/src/mix.rs @@ -255,7 +255,6 @@ impl Destroy { mod tests { use super::*; use crate::Element; - use std::convert::TryFrom; #[test] fn participant() { diff --git a/parsers/src/mood.rs b/parsers/src/mood.rs index 4270c58..27263e3 100644 --- a/parsers/src/mood.rs +++ b/parsers/src/mood.rs @@ -272,7 +272,6 @@ generate_elem_id!( mod tests { use super::*; use crate::Element; - use std::convert::TryFrom; #[cfg(target_pointer_width = "32")] #[test] diff --git a/parsers/src/muc/muc.rs b/parsers/src/muc/muc.rs index 28bee20..b9eb8e8 100644 --- a/parsers/src/muc/muc.rs +++ b/parsers/src/muc/muc.rs @@ -96,7 +96,6 @@ mod tests { use super::*; use crate::util::error::Error; use crate::Element; - use std::convert::TryFrom; use std::str::FromStr; #[test] diff --git a/parsers/src/muc/user.rs b/parsers/src/muc/user.rs index c4947d7..a04de98 100644 --- a/parsers/src/muc/user.rs +++ b/parsers/src/muc/user.rs @@ -12,7 +12,6 @@ use crate::util::error::Error; use crate::Element; use jid::FullJid; -use std::convert::TryFrom; generate_attribute_enum!( /// Lists all of the possible status codes used in MUC presences. diff --git a/parsers/src/nick.rs b/parsers/src/nick.rs index 20ae7a9..7294881 100644 --- a/parsers/src/nick.rs +++ b/parsers/src/nick.rs @@ -17,7 +17,6 @@ mod tests { #[cfg(not(feature = "disable-validation"))] use crate::util::error::Error; use crate::Element; - use std::convert::TryFrom; #[cfg(target_pointer_width = "32")] #[test] diff --git a/parsers/src/occupant_id.rs b/parsers/src/occupant_id.rs index fd11b5b..e21cfe8 100644 --- a/parsers/src/occupant_id.rs +++ b/parsers/src/occupant_id.rs @@ -28,7 +28,6 @@ mod tests { use super::*; use crate::util::error::Error; use crate::Element; - use std::convert::TryFrom; #[cfg(target_pointer_width = "32")] #[test] diff --git a/parsers/src/ping.rs b/parsers/src/ping.rs index 70663fa..9af3a14 100644 --- a/parsers/src/ping.rs +++ b/parsers/src/ping.rs @@ -23,7 +23,6 @@ mod tests { #[cfg(not(feature = "disable-validation"))] use crate::util::error::Error; use crate::Element; - use std::convert::TryFrom; #[test] fn test_size() { diff --git a/parsers/src/presence.rs b/parsers/src/presence.rs index efe799e..de7ea2b 100644 --- a/parsers/src/presence.rs +++ b/parsers/src/presence.rs @@ -10,7 +10,6 @@ use crate::util::error::Error; use jid::Jid; use minidom::{Element, IntoAttributeValue}; use std::collections::BTreeMap; -use std::convert::TryFrom; use std::str::FromStr; /// Should be implemented on every known payload of a ``. diff --git a/parsers/src/pubsub/event.rs b/parsers/src/pubsub/event.rs index 7ce13c6..7dec898 100644 --- a/parsers/src/pubsub/event.rs +++ b/parsers/src/pubsub/event.rs @@ -12,7 +12,6 @@ use crate::pubsub::{Item as PubSubItem, ItemId, NodeName, Subscription, Subscrip use crate::util::error::Error; use crate::Element; use jid::Jid; -use std::convert::TryFrom; /// Event wrapper for a PubSub ``. #[derive(Debug, Clone)] diff --git a/parsers/src/pubsub/owner.rs b/parsers/src/pubsub/owner.rs index 6d94b2f..13662ad 100644 --- a/parsers/src/pubsub/owner.rs +++ b/parsers/src/pubsub/owner.rs @@ -12,7 +12,6 @@ use crate::pubsub::{AffiliationAttribute, NodeName, Subscription}; use crate::util::error::Error; use crate::Element; use jid::Jid; -use std::convert::TryFrom; generate_element!( /// A list of affiliations you have on a service, or on a node. diff --git a/parsers/src/pubsub/pubsub.rs b/parsers/src/pubsub/pubsub.rs index 0fdf648..6633300 100644 --- a/parsers/src/pubsub/pubsub.rs +++ b/parsers/src/pubsub/pubsub.rs @@ -13,7 +13,6 @@ use crate::pubsub::{ use crate::util::error::Error; use crate::Element; use jid::Jid; -use std::convert::TryFrom; // TODO: a better solution would be to split this into a query and a result elements, like for // XEP-0030. diff --git a/parsers/src/receipts.rs b/parsers/src/receipts.rs index 62fd7b7..a96f303 100644 --- a/parsers/src/receipts.rs +++ b/parsers/src/receipts.rs @@ -34,7 +34,6 @@ mod tests { use crate::ns; use crate::util::error::Error; use crate::Element; - use std::convert::TryFrom; #[cfg(target_pointer_width = "32")] #[test] diff --git a/parsers/src/roster.rs b/parsers/src/roster.rs index 5062bb1..9eca2e9 100644 --- a/parsers/src/roster.rs +++ b/parsers/src/roster.rs @@ -93,7 +93,6 @@ mod tests { use super::*; use crate::util::error::Error; use crate::Element; - use std::convert::TryFrom; use std::str::FromStr; #[cfg(target_pointer_width = "32")] diff --git a/parsers/src/rsm.rs b/parsers/src/rsm.rs index f5649c7..9eb11dd 100644 --- a/parsers/src/rsm.rs +++ b/parsers/src/rsm.rs @@ -7,7 +7,6 @@ use crate::ns; use crate::util::error::Error; use crate::Element; -use std::convert::TryFrom; /// Requests paging through a potentially big set of items (represented by an /// UID). diff --git a/parsers/src/rtt.rs b/parsers/src/rtt.rs index b8fa6a5..adacfdd 100644 --- a/parsers/src/rtt.rs +++ b/parsers/src/rtt.rs @@ -8,7 +8,6 @@ use crate::ns; use crate::util::error::Error; use crate::util::helpers::PlainText; use crate::Element; -use std::convert::TryFrom; generate_attribute!( /// Events for real-time text. @@ -245,7 +244,6 @@ impl From for Element { #[cfg(test)] mod tests { use super::*; - use std::convert::TryInto; #[cfg(target_pointer_width = "32")] #[test] diff --git a/parsers/src/sasl.rs b/parsers/src/sasl.rs index b8b46e9..f672182 100644 --- a/parsers/src/sasl.rs +++ b/parsers/src/sasl.rs @@ -9,7 +9,6 @@ use crate::util::error::Error; use crate::util::helpers::Base64; use crate::Element; use std::collections::BTreeMap; -use std::convert::TryFrom; generate_attribute!( /// The list of available SASL mechanisms. @@ -215,7 +214,6 @@ impl From for Element { mod tests { use super::*; use crate::Element; - use std::convert::TryFrom; #[cfg(target_pointer_width = "32")] #[test] diff --git a/parsers/src/server_info.rs b/parsers/src/server_info.rs index 3ad9e00..a68d7de 100644 --- a/parsers/src/server_info.rs +++ b/parsers/src/server_info.rs @@ -6,7 +6,6 @@ use crate::data_forms::{DataForm, DataFormType, Field, FieldType}; use crate::ns; use crate::util::error::Error; -use std::convert::TryFrom; /// Structure representing a `http://jabber.org/network/serverinfo` form type. #[derive(Debug, Clone, PartialEq, Default)] diff --git a/parsers/src/sm.rs b/parsers/src/sm.rs index 04d477e..cdf349e 100644 --- a/parsers/src/sm.rs +++ b/parsers/src/sm.rs @@ -146,7 +146,6 @@ generate_empty_element!( mod tests { use super::*; use crate::Element; - use std::convert::TryFrom; #[cfg(target_pointer_width = "32")] #[test] diff --git a/parsers/src/stanza_error.rs b/parsers/src/stanza_error.rs index c6ae569..ec7ee76 100644 --- a/parsers/src/stanza_error.rs +++ b/parsers/src/stanza_error.rs @@ -11,7 +11,6 @@ use crate::util::error::Error; use crate::Element; use jid::Jid; use std::collections::BTreeMap; -use std::convert::TryFrom; generate_attribute!( /// The type of the error. diff --git a/parsers/src/stanza_id.rs b/parsers/src/stanza_id.rs index bc72e12..3d80a6e 100644 --- a/parsers/src/stanza_id.rs +++ b/parsers/src/stanza_id.rs @@ -40,7 +40,6 @@ mod tests { use crate::util::error::Error; use crate::Element; use jid::BareJid; - use std::convert::TryFrom; #[cfg(target_pointer_width = "32")] #[test] diff --git a/parsers/src/stream.rs b/parsers/src/stream.rs index 98a99c6..c5edb98 100644 --- a/parsers/src/stream.rs +++ b/parsers/src/stream.rs @@ -74,7 +74,6 @@ impl Stream { mod tests { use super::*; use crate::Element; - use std::convert::TryFrom; #[cfg(target_pointer_width = "32")] #[test] diff --git a/parsers/src/time.rs b/parsers/src/time.rs index 1ccb729..ef9a42c 100644 --- a/parsers/src/time.rs +++ b/parsers/src/time.rs @@ -10,7 +10,6 @@ use crate::ns; use crate::util::error::Error; use crate::Element; use chrono::FixedOffset; -use std::convert::TryFrom; use std::str::FromStr; generate_empty_element!( diff --git a/parsers/src/tune.rs b/parsers/src/tune.rs index e80dad4..8b1ae5d 100644 --- a/parsers/src/tune.rs +++ b/parsers/src/tune.rs @@ -8,7 +8,6 @@ use crate::ns; use crate::pubsub::PubSubPayload; use crate::util::error::Error; use crate::Element; -use std::convert::TryFrom; generate_elem_id!( /// The artist or performer of the song or piece. diff --git a/parsers/src/version.rs b/parsers/src/version.rs index 2bd894b..af417ab 100644 --- a/parsers/src/version.rs +++ b/parsers/src/version.rs @@ -42,7 +42,6 @@ impl IqResultPayload for VersionResult {} mod tests { use super::*; use crate::Element; - use std::convert::TryFrom; #[cfg(target_pointer_width = "32")] #[test] diff --git a/parsers/src/websocket.rs b/parsers/src/websocket.rs index 001fe8a..3c23405 100644 --- a/parsers/src/websocket.rs +++ b/parsers/src/websocket.rs @@ -73,7 +73,6 @@ impl Open { mod tests { use super::*; use crate::Element; - use std::convert::TryFrom; #[cfg(target_pointer_width = "32")] #[test] diff --git a/parsers/src/xhtml.rs b/parsers/src/xhtml.rs index dbda397..dcd259f 100644 --- a/parsers/src/xhtml.rs +++ b/parsers/src/xhtml.rs @@ -9,7 +9,6 @@ use crate::ns; use crate::util::error::Error; use minidom::{Element, Node}; use std::collections::HashMap; -use std::convert::TryFrom; // TODO: Use a proper lang type. type Lang = String; diff --git a/sasl/Cargo.toml b/sasl/Cargo.toml index e9177ee..994677b 100644 --- a/sasl/Cargo.toml +++ b/sasl/Cargo.toml @@ -9,7 +9,7 @@ documentation = "https://docs.rs/sasl" readme = "README.md" keywords = ["sasl", "authentication"] license = "MPL-2.0" -edition = "2018" +edition = "2021" [badges] gitlab = { repository = "xmpp-rs/xmpp-rs" } diff --git a/sasl/src/server/mod.rs b/sasl/src/server/mod.rs index 897b000..889abac 100644 --- a/sasl/src/server/mod.rs +++ b/sasl/src/server/mod.rs @@ -14,7 +14,7 @@ macro_rules! impl_validator_using_provider { identity: &$crate::common::Identity, value: &$secret, ) -> Result<(), $crate::server::ValidatorError> { - if &(self as &$crate::server::Provider<$secret>).provide(identity)? == value { + if $crate::server::Provider::<$secret>::provide(self, identity).is_ok() { Ok(()) } else { Err($crate::server::ValidatorError::AuthenticationFailed) diff --git a/tokio-xmpp/Cargo.toml b/tokio-xmpp/Cargo.toml index b4ff77a..dbdf6b0 100644 --- a/tokio-xmpp/Cargo.toml +++ b/tokio-xmpp/Cargo.toml @@ -9,7 +9,7 @@ repository = "https://gitlab.com/xmpp-rs/xmpp-rs" documentation = "https://docs.rs/tokio-xmpp" categories = ["asynchronous", "network-programming"] keywords = ["xmpp", "tokio"] -edition = "2018" +edition = "2021" [dependencies] bytes = "1" diff --git a/tokio-xmpp/examples/contact_addr.rs b/tokio-xmpp/examples/contact_addr.rs index 640d383..c5ff776 100644 --- a/tokio-xmpp/examples/contact_addr.rs +++ b/tokio-xmpp/examples/contact_addr.rs @@ -1,5 +1,4 @@ use futures::stream::StreamExt; -use std::convert::TryFrom; use std::env::args; use std::process::exit; use std::str::FromStr; diff --git a/tokio-xmpp/examples/download_avatars.rs b/tokio-xmpp/examples/download_avatars.rs index a5c8438..454e969 100644 --- a/tokio-xmpp/examples/download_avatars.rs +++ b/tokio-xmpp/examples/download_avatars.rs @@ -1,5 +1,4 @@ use futures::stream::StreamExt; -use std::convert::TryFrom; use std::env::args; use std::fs::{create_dir_all, File}; use std::io::{self, Write}; diff --git a/tokio-xmpp/examples/echo_bot.rs b/tokio-xmpp/examples/echo_bot.rs index 7c07ec3..3c2022f 100644 --- a/tokio-xmpp/examples/echo_bot.rs +++ b/tokio-xmpp/examples/echo_bot.rs @@ -1,5 +1,4 @@ use futures::stream::StreamExt; -use std::convert::TryFrom; use std::env::args; use std::process::exit; use std::str::FromStr; diff --git a/tokio-xmpp/examples/echo_component.rs b/tokio-xmpp/examples/echo_component.rs index 832b2fd..9f3425e 100644 --- a/tokio-xmpp/examples/echo_component.rs +++ b/tokio-xmpp/examples/echo_component.rs @@ -1,5 +1,4 @@ use futures::stream::StreamExt; -use std::convert::TryFrom; use std::env::args; use std::process::exit; use std::str::FromStr; diff --git a/tokio-xmpp/src/client/auth.rs b/tokio-xmpp/src/client/auth.rs index a5560a9..94114a0 100644 --- a/tokio-xmpp/src/client/auth.rs +++ b/tokio-xmpp/src/client/auth.rs @@ -4,7 +4,6 @@ use sasl::client::Mechanism; use sasl::common::scram::{Sha1, Sha256}; use sasl::common::Credentials; use std::collections::HashSet; -use std::convert::TryFrom; use std::str::FromStr; use tokio::io::{AsyncRead, AsyncWrite}; use xmpp_parsers::sasl::{Auth, Challenge, Failure, Mechanism as XMPPMechanism, Response, Success}; diff --git a/tokio-xmpp/src/client/bind.rs b/tokio-xmpp/src/client/bind.rs index 9172c12..a6b7e7e 100644 --- a/tokio-xmpp/src/client/bind.rs +++ b/tokio-xmpp/src/client/bind.rs @@ -1,5 +1,4 @@ use futures::stream::StreamExt; -use std::convert::TryFrom; use std::marker::Unpin; use tokio::io::{AsyncRead, AsyncWrite}; use xmpp_parsers::bind::{BindQuery, BindResponse}; diff --git a/tokio-xmpp/src/starttls.rs b/tokio-xmpp/src/starttls.rs index c27caf0..73d72f8 100644 --- a/tokio-xmpp/src/starttls.rs +++ b/tokio-xmpp/src/starttls.rs @@ -2,7 +2,6 @@ use futures::{sink::SinkExt, stream::StreamExt}; #[cfg(all(feature = "tls-rust", not(feature = "tls-native")))] use { - std::convert::TryFrom, std::sync::Arc, tokio_rustls::{ client::TlsStream, diff --git a/xmpp/Cargo.toml b/xmpp/Cargo.toml index a8d255e..bd5cee1 100644 --- a/xmpp/Cargo.toml +++ b/xmpp/Cargo.toml @@ -11,7 +11,7 @@ repository = "https://gitlab.com/xmpp-rs/xmpp-rs" keywords = ["xmpp", "jabber", "chat", "messaging", "bot"] categories = ["network-programming"] license = "MPL-2.0" -edition = "2018" +edition = "2021" [dependencies] tokio-xmpp = "3.4" diff --git a/xmpp/src/lib.rs b/xmpp/src/lib.rs index 98168cd..75cf9f7 100644 --- a/xmpp/src/lib.rs +++ b/xmpp/src/lib.rs @@ -10,7 +10,6 @@ use futures::stream::StreamExt; use reqwest::{ header::HeaderMap as ReqwestHeaderMap, Body as ReqwestBody, Client as ReqwestClient, }; -use std::convert::TryFrom; use std::path::{Path, PathBuf}; use std::sync::{Arc, RwLock}; use tokio::fs::File; diff --git a/xmpp/src/pubsub/avatar.rs b/xmpp/src/pubsub/avatar.rs index 598cf9e..02e103f 100644 --- a/xmpp/src/pubsub/avatar.rs +++ b/xmpp/src/pubsub/avatar.rs @@ -6,7 +6,6 @@ use super::Agent; use crate::Event; -use std::convert::TryFrom; use std::fs::{self, File}; use std::io::{self, Write}; use tokio_xmpp::parsers::{ diff --git a/xmpp/src/pubsub/mod.rs b/xmpp/src/pubsub/mod.rs index 9234a09..167c9c2 100644 --- a/xmpp/src/pubsub/mod.rs +++ b/xmpp/src/pubsub/mod.rs @@ -6,7 +6,6 @@ use super::Agent; use crate::Event; -use std::convert::TryFrom; use std::str::FromStr; use tokio_xmpp::parsers::{ bookmarks2::{Autojoin, Conference},