From 1bab5c3cd9ca231545f913cad9e5a7cd874b1a02 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Tue, 27 Feb 2024 15:16:47 +0100 Subject: [PATCH] Remove redundant imports These became warnings in a recent nightly. The TryFrom/TryInto imports were missed in 4089891f6c96bb025de8c9a77b2e58b568534a74, but the rest are truly redundant. --- minidom/src/error.rs | 1 - parsers/src/bookmarks2.rs | 1 - parsers/src/ecaps2.rs | 1 - parsers/src/http_upload.rs | 1 - parsers/src/mam.rs | 2 -- parsers/src/pubsub/owner.rs | 2 +- parsers/src/pubsub/pubsub.rs | 2 +- parsers/src/reactions.rs | 1 - parsers/src/sasl.rs | 1 - parsers/src/server_info.rs | 1 - parsers/src/vcard.rs | 1 - sasl/src/common/mod.rs | 3 --- tokio-xmpp/examples/download_avatars.rs | 1 - tokio-xmpp/examples/echo_bot.rs | 1 - tokio-xmpp/examples/send_message.rs | 1 - tokio-xmpp/src/client/bind.rs | 1 - tokio-xmpp/src/component/auth.rs | 1 - tokio-xmpp/src/starttls/happy_eyeballs.rs | 1 - tokio-xmpp/src/starttls/mod.rs | 1 - tokio-xmpp/src/stream_start.rs | 1 - tokio-xmpp/src/xmpp_codec.rs | 3 --- xmpp/examples/hello_bot.rs | 1 - 22 files changed, 2 insertions(+), 27 deletions(-) diff --git a/minidom/src/error.rs b/minidom/src/error.rs index 0ccfd6d..408fcaf 100644 --- a/minidom/src/error.rs +++ b/minidom/src/error.rs @@ -11,7 +11,6 @@ //! Provides an error type for this crate. -use std::convert::From; use std::error::Error as StdError; /// Our main error type. diff --git a/parsers/src/bookmarks2.rs b/parsers/src/bookmarks2.rs index 9495113..d380477 100644 --- a/parsers/src/bookmarks2.rs +++ b/parsers/src/bookmarks2.rs @@ -132,7 +132,6 @@ impl From for Element { mod tests { use super::*; use crate::pubsub::{pubsub::Item as PubSubItem, PubSubEvent}; - use crate::Element; #[cfg(target_pointer_width = "32")] #[test] diff --git a/parsers/src/ecaps2.rs b/parsers/src/ecaps2.rs index 873c615..217d046 100644 --- a/parsers/src/ecaps2.rs +++ b/parsers/src/ecaps2.rs @@ -183,7 +183,6 @@ pub fn query_ecaps2(hash: Hash) -> DiscoInfoQuery { #[cfg(test)] mod tests { use super::*; - use crate::util::error::Error; use crate::Element; #[cfg(target_pointer_width = "32")] diff --git a/parsers/src/http_upload.rs b/parsers/src/http_upload.rs index 84b3cc6..21479fe 100644 --- a/parsers/src/http_upload.rs +++ b/parsers/src/http_upload.rs @@ -114,7 +114,6 @@ impl IqResultPayload for SlotResult {} #[cfg(test)] mod tests { use super::*; - use crate::Element; #[test] fn test_slot_request() { diff --git a/parsers/src/mam.rs b/parsers/src/mam.rs index 21e09f3..c1e7161 100644 --- a/parsers/src/mam.rs +++ b/parsers/src/mam.rs @@ -160,8 +160,6 @@ impl IqResultPayload for Fin {} #[cfg(test)] mod tests { use super::*; - use crate::util::error::Error; - use minidom::Element; #[cfg(target_pointer_width = "32")] #[test] diff --git a/parsers/src/pubsub/owner.rs b/parsers/src/pubsub/owner.rs index 13662ad..4ecea7b 100644 --- a/parsers/src/pubsub/owner.rs +++ b/parsers/src/pubsub/owner.rs @@ -185,7 +185,7 @@ impl From for Element { #[cfg(test)] mod tests { use super::*; - use crate::data_forms::{DataForm, DataFormType, Field, FieldType}; + use crate::data_forms::{DataFormType, Field, FieldType}; use jid::BareJid; use std::str::FromStr; diff --git a/parsers/src/pubsub/pubsub.rs b/parsers/src/pubsub/pubsub.rs index 6633300..ec90279 100644 --- a/parsers/src/pubsub/pubsub.rs +++ b/parsers/src/pubsub/pubsub.rs @@ -544,7 +544,7 @@ impl From for Element { #[cfg(test)] mod tests { use super::*; - use crate::data_forms::{DataForm, DataFormType, Field, FieldType}; + use crate::data_forms::{DataFormType, Field, FieldType}; #[test] fn create() { diff --git a/parsers/src/reactions.rs b/parsers/src/reactions.rs index 7638f0d..aff6932 100644 --- a/parsers/src/reactions.rs +++ b/parsers/src/reactions.rs @@ -35,7 +35,6 @@ generate_element!( mod tests { use super::*; use crate::Element; - use std::convert::{TryFrom, TryInto}; #[cfg(target_pointer_width = "32")] #[test] diff --git a/parsers/src/sasl.rs b/parsers/src/sasl.rs index 3ce3bff..b15cd6c 100644 --- a/parsers/src/sasl.rs +++ b/parsers/src/sasl.rs @@ -213,7 +213,6 @@ impl From for Element { #[cfg(test)] mod tests { use super::*; - use crate::Element; #[cfg(target_pointer_width = "32")] #[test] diff --git a/parsers/src/server_info.rs b/parsers/src/server_info.rs index a68d7de..3ad6828 100644 --- a/parsers/src/server_info.rs +++ b/parsers/src/server_info.rs @@ -100,7 +100,6 @@ pub fn generate_address_field>(var: S, values: Vec) -> F #[cfg(test)] mod tests { use super::*; - use crate::data_forms::{DataForm, DataFormType, Field, FieldType}; #[cfg(target_pointer_width = "32")] #[test] diff --git a/parsers/src/vcard.rs b/parsers/src/vcard.rs index 87b01df..11170b7 100644 --- a/parsers/src/vcard.rs +++ b/parsers/src/vcard.rs @@ -95,7 +95,6 @@ impl IqResultPayload for VCard {} #[cfg(test)] mod tests { use super::*; - use crate::Element; use base64::Engine; use std::str::FromStr; diff --git a/sasl/src/common/mod.rs b/sasl/src/common/mod.rs index 5016cfb..36d7e1d 100644 --- a/sasl/src/common/mod.rs +++ b/sasl/src/common/mod.rs @@ -1,7 +1,4 @@ use std::collections::HashMap; - -use std::convert::From; - use std::string::FromUtf8Error; #[cfg(feature = "scram")] diff --git a/tokio-xmpp/examples/download_avatars.rs b/tokio-xmpp/examples/download_avatars.rs index 454e969..d8dbd67 100644 --- a/tokio-xmpp/examples/download_avatars.rs +++ b/tokio-xmpp/examples/download_avatars.rs @@ -4,7 +4,6 @@ use std::fs::{create_dir_all, File}; use std::io::{self, Write}; use std::process::exit; use std::str::FromStr; -use tokio; use tokio_xmpp::AsyncClient as Client; use xmpp_parsers::{ avatar::{Data as AvatarData, Metadata as AvatarMetadata}, diff --git a/tokio-xmpp/examples/echo_bot.rs b/tokio-xmpp/examples/echo_bot.rs index 3c2022f..9be2173 100644 --- a/tokio-xmpp/examples/echo_bot.rs +++ b/tokio-xmpp/examples/echo_bot.rs @@ -2,7 +2,6 @@ use futures::stream::StreamExt; use std::env::args; use std::process::exit; use std::str::FromStr; -use tokio; use tokio_xmpp::AsyncClient as Client; use xmpp_parsers::message::{Body, Message, MessageType}; use xmpp_parsers::presence::{Presence, Show as PresenceShow, Type as PresenceType}; diff --git a/tokio-xmpp/examples/send_message.rs b/tokio-xmpp/examples/send_message.rs index 5b56989..d929cd6 100644 --- a/tokio-xmpp/examples/send_message.rs +++ b/tokio-xmpp/examples/send_message.rs @@ -2,7 +2,6 @@ use std::env::args; use std::io::{stdin, Read}; use std::process::exit; use std::str::FromStr; -use tokio; use tokio_xmpp::SimpleClient as Client; use xmpp_parsers::message::{Body, Message}; use xmpp_parsers::Jid; diff --git a/tokio-xmpp/src/client/bind.rs b/tokio-xmpp/src/client/bind.rs index a6b7e7e..b3dfcc8 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::marker::Unpin; use tokio::io::{AsyncRead, AsyncWrite}; use xmpp_parsers::bind::{BindQuery, BindResponse}; use xmpp_parsers::iq::{Iq, IqType}; diff --git a/tokio-xmpp/src/component/auth.rs b/tokio-xmpp/src/component/auth.rs index 58ad812..36f2bf7 100644 --- a/tokio-xmpp/src/component/auth.rs +++ b/tokio-xmpp/src/component/auth.rs @@ -1,5 +1,4 @@ use futures::stream::StreamExt; -use std::marker::Unpin; use tokio::io::{AsyncRead, AsyncWrite}; use xmpp_parsers::{component::Handshake, ns}; diff --git a/tokio-xmpp/src/starttls/happy_eyeballs.rs b/tokio-xmpp/src/starttls/happy_eyeballs.rs index 04879af..0753088 100644 --- a/tokio-xmpp/src/starttls/happy_eyeballs.rs +++ b/tokio-xmpp/src/starttls/happy_eyeballs.rs @@ -1,6 +1,5 @@ use super::error::{ConnectorError, Error}; use hickory_resolver::{IntoName, TokioAsyncResolver}; -use idna; use log::debug; use std::net::SocketAddr; use tokio::net::TcpStream; diff --git a/tokio-xmpp/src/starttls/mod.rs b/tokio-xmpp/src/starttls/mod.rs index 224d0b3..4e6387a 100644 --- a/tokio-xmpp/src/starttls/mod.rs +++ b/tokio-xmpp/src/starttls/mod.rs @@ -10,7 +10,6 @@ use { rustls::{ClientConfig, OwnedTrustAnchor, RootCertStore, ServerName}, TlsConnector, }, - webpki_roots, }; #[cfg(feature = "tls-native")] diff --git a/tokio-xmpp/src/stream_start.rs b/tokio-xmpp/src/stream_start.rs index 06763bf..7c7d4d2 100644 --- a/tokio-xmpp/src/stream_start.rs +++ b/tokio-xmpp/src/stream_start.rs @@ -1,5 +1,4 @@ use futures::{sink::SinkExt, stream::StreamExt}; -use std::marker::Unpin; use tokio::io::{AsyncRead, AsyncWrite}; use tokio_util::codec::Framed; use xmpp_parsers::{ns, Element, Jid}; diff --git a/tokio-xmpp/src/xmpp_codec.rs b/tokio-xmpp/src/xmpp_codec.rs index 4cb1f73..d16e95c 100644 --- a/tokio-xmpp/src/xmpp_codec.rs +++ b/tokio-xmpp/src/xmpp_codec.rs @@ -5,9 +5,7 @@ use bytes::{BufMut, BytesMut}; use log::debug; use minidom::tree_builder::TreeBuilder; use rxml::{Lexer, PushDriver, RawParser}; -use std; use std::collections::HashMap; -use std::default::Default; use std::fmt::Write; use std::io; #[cfg(feature = "syntax-highlighting")] @@ -252,7 +250,6 @@ impl<'a> std::io::Write for WriteBytes<'a> { #[cfg(test)] mod tests { use super::*; - use bytes::BytesMut; #[test] fn test_stream_start() { diff --git a/xmpp/examples/hello_bot.rs b/xmpp/examples/hello_bot.rs index 2642277..dac0ac6 100644 --- a/xmpp/examples/hello_bot.rs +++ b/xmpp/examples/hello_bot.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 env_logger; use std::env::args; use std::str::FromStr; use tokio_xmpp::parsers::{message::MessageType, BareJid, Jid};