diff --git a/Cargo.toml b/Cargo.toml
index f3b55c090dd8c731730cbb0d37647d35576ff169..80a8a02626b10051dbb725cd8bce5bbe671004d7 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 4e77353f69ec9d054372e8bb348c0898db7266d5..df12387e46ba11cb22809d20733bbea67c3478d9 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 6f746a2dc9d6f42a518cd1f9642961110ba584b9..ada59384cde34c9499719a9967453a32197b09e0 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 b31f09947b738a9571bf0d4958b16ce6783ff10b..4e8f3fb8e33feaa58882d398e7ba41a92cc96215 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 f1d1bba06dcc7d7af8517008301741b2efebd52a..996f600579263b62b8e3bfb62e1a293eede950b3 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 b7f22316162e4d1f165f9c6209d85c6fe819d00b..7486466c135b290ab47cd106690af0be6a8be680 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 54393718e54d1e4ef91d876d866fbe034cad77ec..b4352f950405959064ad697f45aaba1642733dce 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 a36963aac0dcb57a05055efe49b4a69e1d5025d9..9c06169dabc840d7e9850f8b083a98a19eb47002 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 83a871ccfba3a0dc3c31e4e71839b8e157512dde..8e7577a578259fb0ebe0f04c64a0d449a443c1da 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 0c1eecca933825059ec0a774fcee1edb25dd113c..1a334a12801c2addddcb25f83bc3cb490a768554 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 dc75307b9b49adc431e808da2ab0a97f5fe81953..6d02b568b7ca5c630298c7f15f409d06623267fe 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 7d1fad08a41a23920ba389541f842edb5c6ec56f..464b13948ff154a1cb7b387d1229edd3812129ee 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 dd18e25e6569d7dabfdb768b1cb51c11693219ba..8e34ef415daf7755271444709c15b55ccfa81468 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 9ed2433bcdc93da6423f60d0d6173858241644be..1f68ce536673bf37e201fcef38020ce1981cb69b 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 1a6d079744e971cefa72968fc92b9221ef352b9c..16ca307f46aff47c66179c666bbf0c25de711570 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 673d00ac582bf3e7e60a750c16d1deb99d75582e..d3990b4ec619e749328acb23e6738b4de3043b49 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 010830f7387c31aa4b76784343c6285bc24024de..f528354382611ebde8f88c66e4e522df00acd46f 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 0d7ed2f4edfd15182ce7a2b6ea834dde96ed049d..c53e77421ed006304958c8c10cd91b029b02340c 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 5e98112bbb070e1935775048391ff1735b0fb4a9..e9c83a03870ccc646402849356e6f0ff993ab79d 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 b8120ffde74e18f3ae3120489090525d6adfe6f4..c7329332bbd0f531ca5cad56c74414192dc7fb35 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 bfd44f8469ffd749eb72ca991e62fc4a160205b9..3d26463177f115a57d0214e25174af2f09cd5c21 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 e1eb4733148aed8c9df3062172c0586562af3f2a..6e7572ee9ccfee392a06acbda4c8c21985a65f4b 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 dcaad9f689eba2dba971a617af5a9dd7eaae7f1d..028ce57440e87137eb76451eb863b65aee02329e 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 8eff50b3a9888fbeadd134e812c276b696966baa..1d7a7ff0875b92e4e80d031c2ad198368eeda15f 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 107b0f8db293c4c6ec5d74ba8c9e0652e5081916..873c61557e911886f93e2db1db076a94dc4bebd0 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 1014318e36eceb79dd3ef0313969aa7d3102596a..5a624a30f98a224ede3da611fb3b088f535fd86d 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 c95e65374a8f490ff0436038d356cf9ac8d3794f..ded6312c3efe233287ac384e89163c5d06018c70 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 75008ea4147ceaf09a629348c9b8ea2ca50ed5d7..28984fa5f4269511a8e88079860373a87b9fd4a1 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 f4b3a9ceec71566ce934d1f0bc96c7d1e43fd401..a1e0cefc792cfb77800684aea1ce94b8766f3295 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 39815ab6c22eda81a71101ab7b41fa27bd87bf3e..84b3cc6d3a55353ec980a75997a761a942ad918e 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 3e4ab5757185e0cec6e1d69aa240b147e4920482..32f9f08497185cf32d5ab82c0f2212ee830c2a51 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 71ce324618fc0ca5cd97ba8bc8a44619c7a82d2a..13b25b18b718e0080c1f75c7ef90421051d7db63 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 a575b32169f4dd03f3da6a766a9caffc5af2c52f..c5ea025b685ac957ce94b54105e43ce5a478f603 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 b725a8f9e77dddf98b30987b8836cb9d61cd7a1c..2d4451d6e1a2c54de14d6f0963a02ea35194e1b3 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 74683634a7ec92ff9e8ffd88501cd531b1518acc..a6f0f80f3d5b0a3fba88079ff21019147f98e62c 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 e97cd6614c47469ad31cb552b06edc8809157c70..bddc3c52166680883ca26a681c5b0bf3daec893f 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 a586946821a7c971d530db0c068d5b5d5f2c9834..21d193a2eb162ac9cb1eada65b169a1883b806fa 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 270a1f1156a28b4e5f0223b9b239699080ae0b65..67c7a98be55adb75e7caa32513fe709066bf46b6 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 cda993ca29c6b72f9728956777e599ed13b7bbe0..b3fc33956093f9a3037116e9ddf6307264a2c088 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 3018842e8bd3bcc0f69591fe7cfb4ae153de6baf..e3680907ba0529c31f2d31ef5162bf23e5d272be 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 a9907ad676c9662f78bded02bf24b10c684957c7..f464288b96379fe4c115f8292f7005a3528864f6 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 69221e7015aaf21b1fdb11ae51d3eb4b3bd75f63..c32da472e8ce904714d963ac0be3d267bc78c23a 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 bf3c4b147b52b389482f478766b5cfa3f3d9f910..3063dca1c36594815f080aa7d059305e76746e1e 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 d02a589d1193c2208e30096a7d118cbaf73cc8ec..ee64aee6f75860bd8ae8aad3d350675856dd6fef 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 d0566d744578fe1aa98d5c6f702bf091593ddfdf..ef3ae62e60aa4210cba65e8094aa4e1e9f3d387c 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 7aceca5890f0963a9f21a36c7f2ff2839c983a10..2f8ba070c6ac930839af0b4dde31162112ccb807 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 2a5ba02ccae275ab019d9a66476acb5cb6a6760f..a8db30bf8353c3eb816cf946d5e9b5a60c23b8fc 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 a67f71d6f63626d90f633b0b359302b8161c73cf..2ca6f713a0938664a00202cceca531ef9f8bc96b 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 ae7ace0a67ba0412d140bef2abf48e1529066081..cf9691426b079297f9905f1bad4898f828a44b5e 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 42c541c855fd908e99f5a0bd9a3701ceb7d652f9..f8839fe97457d85190505e778391bc748bea018b 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 589809e3135de800a8aff8b5c43c6bb1ce988709..52a9902cbe15d2a181ef2fe98c367ae14a07266b 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 536c0dd401f86ce70d29273553e8889712f9223c..cfe32508bab0619ecaf9f2345c52d8789955c532 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 4a34c06639b37c88e2f71384656601bbc3a5f5b6..50fe4213bdfd25a351a48a5285a8859b38955bcf 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 374900f41304c35e879e6d5980a9aa767d20fedf..2291ede06a2813d57bae494ac9558d5f644907ad 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 135a650b469c8c970eeeafa7e712d9fc8d13568e..e6e30bb7ce54d0f8e1dfe9dc0d46982979833164 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 4270c5889642bbce1c2f2b631175615a38e14586..27263e3a40adaa424dd22b00a0a7e0a1b952641a 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 28bee200cb65b477c1028d470f39c5be57398f53..b9eb8e8b241363030abff213af0a6a982a0cde1a 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 c4947d71c3e342a8dea4c216b05d3a9571c4bb3a..a04de98e7572f3bbeda178f37f6677608a31d646 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 20ae7a94c9cf03eb34751f4b87c2647af521fe2e..729488140f4d789433acc73cd149e674b5586aad 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 fd11b5b492448826e5dfb8dd8983155aaa7df9b2..e21cfe8ccbabfb6cea3e6588c546aeeb5da862f1 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 70663fa3a79d483da66f040b3b2419c4245272f6..9af3a14253bfc8fe2c3866ba037c735aa9925b28 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 efe799e055dbf23a2347886fa1d6f8e1baccabab..de7ea2bbc43d4ab102da9fcc1bfdf710326f50e2 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 7ce13c6663b44dadd3e51b3cc43a70b3de46ad23..7dec89827eb645b6566a51a2a112a496b4f04e82 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 6d94b2f45dfecc6cab7b7e447096bc10b61bf05a..13662ad19ac7b5364a7e86f74b0480153f5a2353 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 0fdf64804407225558969351ae8261b0bdb2c2cc..6633300c346c6043355b596feb5a0c7aa7ac75d0 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 62fd7b777943b499f6c56bd1c37445a91e07c4e9..a96f30319a07ebb4af8a85f1e685ade648785272 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 5062bb132756525beff7a551567886d583505825..9eca2e927b3fd1cbbd0abea8b23582b714661a1b 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 f5649c71e5ab7acd772aa02c52422022aaf4c3ba..9eb11dd001656e6e6cd7884028301c0d8f789696 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 b8fa6a52168d56ffe06bc5dbf1e7e54031347648..adacfdd4c3abc6951cd2da65ae09a4454640b383 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 b8b46e9f455e7b550e5d469bce258996276b3b64..f6721826ed351e2ba66ae1c7108ffc1be07fbacd 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 3ad9e0008786092f03391d6a1617095447ec54dc..a68d7de3c32166f8e74f5177523e3a6740cae86c 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 04d477e3febbe0ca4104ec4eafee9cb2dc83d741..cdf349e7afcead226ad55b03916f34a684a35dd3 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 c6ae56988681f9cf9a9fac7392c2b7a80d9f5fdb..ec7ee764f8ac6d2fc34832aaa479b4191e51f859 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 bc72e1244ef03fc949a53d38e3a3a2251394ee65..3d80a6e13e7e145fede85382ce5f202684ffa048 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 98a99c629c62627ca8f8e2cd89655d2b0196f8a5..c5edb98f5d64466e88747e7e607c32343f6d9fdf 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 1ccb729ca52be3d898a5316b8aa03759827c195c..ef9a42c98d90935ad2248befbb590c4d2fc07ee0 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 e80dad4b6e04e271eb32f9f3ee8cfebc5fc380f1..8b1ae5d59875e138449d4c3ad6e1c0e26d085189 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 2bd894b872c16133d4da599ce79ed94446bd176c..af417abf67b854c958a527aaf185f7b21fc77e94 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 001fe8affa9f810070f902615bc65261aee35c34..3c234056a1737471038d2488a2b5254ef034a917 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 dbda39710bd10f58d3fc9a236c21b03d728ef4c1..dcd259f6aff98a81d165c1577000e2364a21080d 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 e9177ee71a96b50d830413ffa1a2329cb817af81..994677b87101efa53640a4e8c513413bbee00b25 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 897b000d88eb990676e8b532d97d96184432e79b..889abac4a856e6f4b8bcf118a734f1836c8d3a22 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 b4ff77a19e59a509f17c08265faffd6f66e55530..dbdf6b02aa0d7ca28926a0b38f39ab7ae38d87d2 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 640d3833487bce94c09fb92550c581a3e717373c..c5ff776d07a99e32250309101981e826291f2d3c 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 a5c8438af0e9898b0d0fb1925e8cdcf26650259a..454e969425ecee6943686d2f673d5da77e63d281 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 7c07ec353cfee4c91035cad8fd46f3f6b8999cd3..3c2022fe8989a39e6d3ed11ca7d3838271077bde 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 832b2fd3dadcd1779f46c355d9ff956a72f35ce5..9f3425e3ad99ab18c4a3f6d772c57ba06c9df125 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 a5560a9c765adbb2973b7059276313dc44771183..94114a0eb474b7d06cce25fdb91a2b721c309e63 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 9172c12290ac4e05e6cb2ea3816780fdb85359d6..a6b7e7e4ad95ffbb04006b113a0fefdde4a04e4c 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 c27caf0adef0f3d52aa15ee64f2baabab79e607c..73d72f8ab1525a2739916b84530ccdaf84482b66 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 a8d255e9d45be7ab1d239a8175223b0d4b5d9ff5..bd5cee116eb3fbb87df48a6322ae7552f345257c 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 98168cde3a63744ca6fab7d4897de1b5c0b7c2f8..75cf9f7e3ee3b3ff6ef601d3ef54b4aaa3cc59e2 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 598cf9edcbc6ec71b5deceb9a0840605abad1322..02e103f7ed06e0882ab42f7401a48e2ba1226d39 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 9234a0974680181fbe0184bf0f525cf8ca6d8ee9..167c9c22ab49e0902fed3d979de1c41cd7975bfb 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},