Update edition to 2021

- 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 <pep@bouah.net>
This commit is contained in:
Maxime “pep” Buquet 2023-11-11 14:52:55 +01:00 committed by pep
commit 4089891f6c
94 changed files with 8 additions and 100 deletions

View file

@ -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() {

View file

@ -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]

View file

@ -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

View file

@ -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

View file

@ -89,7 +89,6 @@ generate_element!(
mod tests {
use super::*;
use crate::Element;
use std::convert::TryFrom;
#[cfg(target_pointer_width = "32")]
#[test]

View file

@ -71,7 +71,6 @@ impl Storage {
mod tests {
use super::*;
use crate::Element;
use std::convert::TryFrom;
#[cfg(target_pointer_width = "32")]
#[test]

View file

@ -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]

View file

@ -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)]

View file

@ -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]

View file

@ -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")]

View file

@ -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() {

View file

@ -44,7 +44,6 @@ impl Handshake {
mod tests {
use super::*;
use crate::Element;
use std::convert::TryFrom;
#[cfg(target_pointer_width = "32")]
#[test]

View file

@ -30,7 +30,6 @@ mod tests {
use super::*;
use crate::ns;
use crate::Element;
use std::convert::TryFrom;
#[test]
fn test_size() {

View file

@ -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.

View file

@ -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")]

View file

@ -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 `<query xmlns='http://jabber.org/protocol/disco#info'/>` element.

View file

@ -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]

View file

@ -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]

View file

@ -141,7 +141,6 @@ mod tests {
use super::*;
use crate::ns;
use crate::Element;
use std::convert::TryFrom;
#[cfg(target_pointer_width = "32")]
#[test]

View file

@ -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]

View file

@ -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]

View file

@ -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() {

View file

@ -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]

View file

@ -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)]

View file

@ -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]

View file

@ -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 `<iq type='get'/>`.
pub trait IqGetPayload: TryFrom<Element> + Into<Element> {}

View file

@ -42,7 +42,6 @@ mod tests {
use super::*;
use crate::Element;
use jid::FullJid;
use std::convert::TryFrom;
#[cfg(target_pointer_width = "32")]
#[test]

View file

@ -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;

View file

@ -73,7 +73,6 @@ impl Fingerprint {
mod tests {
use super::*;
use crate::Element;
use std::convert::TryFrom;
#[cfg(target_pointer_width = "32")]
#[test]

View file

@ -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!(

View file

@ -52,7 +52,6 @@ generate_element!(
mod tests {
use super::*;
use crate::Element;
use std::convert::TryFrom;
#[cfg(target_pointer_width = "32")]
#[test]

View file

@ -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]

View file

@ -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]

View file

@ -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.

View file

@ -60,7 +60,6 @@ generate_element!(
mod tests {
use super::*;
use crate::Element;
use std::convert::TryFrom;
#[cfg(target_pointer_width = "32")]
#[test]

View file

@ -20,7 +20,6 @@ generate_element!(
mod tests {
use super::*;
use crate::Element;
use std::convert::TryFrom;
#[cfg(target_pointer_width = "32")]
#[test]

View file

@ -153,7 +153,6 @@ generate_element!(
mod tests {
use super::*;
use crate::Element;
use std::convert::TryFrom;
#[cfg(target_pointer_width = "32")]
#[test]

View file

@ -56,7 +56,6 @@ impl RtpHdrext {
mod tests {
use super::*;
use crate::Element;
use std::convert::TryFrom;
#[cfg(target_pointer_width = "32")]
#[test]

View file

@ -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!(

View file

@ -79,7 +79,6 @@ generate_element!(
mod tests {
use super::*;
use crate::Element;
use std::convert::TryFrom;
#[cfg(target_pointer_width = "32")]
#[test]

View file

@ -182,7 +182,6 @@ impl MessagePayload for Encrypted {}
mod tests {
use super::*;
use crate::Element;
use std::convert::TryInto;
#[test]
fn parse_bundle() {

View file

@ -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]

View file

@ -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.

View file

@ -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]

View file

@ -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 `<message/>`.
pub trait MessagePayload: TryFrom<Element> + Into<Element> {}

View file

@ -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]

View file

@ -255,7 +255,6 @@ impl Destroy {
mod tests {
use super::*;
use crate::Element;
use std::convert::TryFrom;
#[test]
fn participant() {

View file

@ -272,7 +272,6 @@ generate_elem_id!(
mod tests {
use super::*;
use crate::Element;
use std::convert::TryFrom;
#[cfg(target_pointer_width = "32")]
#[test]

View file

@ -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]

View file

@ -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.

View file

@ -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]

View file

@ -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]

View file

@ -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() {

View file

@ -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 `<presence/>`.

View file

@ -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 `<item/>`.
#[derive(Debug, Clone)]

View file

@ -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.

View file

@ -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.

View file

@ -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]

View file

@ -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")]

View file

@ -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).

View file

@ -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<Rtt> for Element {
#[cfg(test)]
mod tests {
use super::*;
use std::convert::TryInto;
#[cfg(target_pointer_width = "32")]
#[test]

View file

@ -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<Failure> for Element {
mod tests {
use super::*;
use crate::Element;
use std::convert::TryFrom;
#[cfg(target_pointer_width = "32")]
#[test]

View file

@ -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)]

View file

@ -146,7 +146,6 @@ generate_empty_element!(
mod tests {
use super::*;
use crate::Element;
use std::convert::TryFrom;
#[cfg(target_pointer_width = "32")]
#[test]

View file

@ -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.

View file

@ -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]

View file

@ -74,7 +74,6 @@ impl Stream {
mod tests {
use super::*;
use crate::Element;
use std::convert::TryFrom;
#[cfg(target_pointer_width = "32")]
#[test]

View file

@ -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!(

View file

@ -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.

View file

@ -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]

View file

@ -73,7 +73,6 @@ impl Open {
mod tests {
use super::*;
use crate::Element;
use std::convert::TryFrom;
#[cfg(target_pointer_width = "32")]
#[test]

View file

@ -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;