diff --git a/Cargo.toml b/Cargo.toml index b814544a..cdf2fada 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ documentation = "https://docs.rs/tokio-rustls" readme = "README.md" description = "Asynchronous TLS/SSL streams for Tokio using Rustls." categories = ["asynchronous", "cryptography", "network-programming"] -edition = "2018" +edition = "2021" rust-version = "1.63" [dependencies] diff --git a/examples/client.rs b/examples/client.rs index 7a41844e..3b6eb0f6 100644 --- a/examples/client.rs +++ b/examples/client.rs @@ -1,11 +1,11 @@ -use argh::FromArgs; -use std::convert::TryFrom; use std::fs::File; use std::io; use std::io::BufReader; use std::net::ToSocketAddrs; use std::path::PathBuf; use std::sync::Arc; + +use argh::FromArgs; use tokio::io::{copy, split, stdin as tokio_stdin, stdout as tokio_stdout, AsyncWriteExt}; use tokio::net::TcpStream; use tokio_rustls::rustls::{self, OwnedTrustAnchor}; diff --git a/examples/server.rs b/examples/server.rs index 1a7c1f73..94dcc405 100644 --- a/examples/server.rs +++ b/examples/server.rs @@ -1,10 +1,11 @@ -use argh::FromArgs; -use rustls_pemfile::{certs, rsa_private_keys}; use std::fs::File; use std::io::{self, BufReader}; use std::net::ToSocketAddrs; use std::path::{Path, PathBuf}; use std::sync::Arc; + +use argh::FromArgs; +use rustls_pemfile::{certs, rsa_private_keys}; use tokio::io::{copy, sink, split, AsyncWriteExt}; use tokio::net::TcpListener; use tokio_rustls::rustls::{self, Certificate, PrivateKey}; diff --git a/src/common/test_stream.rs b/src/common/test_stream.rs index 5431b7c6..b643ed24 100644 --- a/src/common/test_stream.rs +++ b/src/common/test_stream.rs @@ -279,8 +279,6 @@ async fn stream_eof() -> io::Result<()> { } fn make_pair() -> (ServerConnection, ClientConnection) { - use std::convert::TryFrom; - let (sconfig, cconfig) = utils::make_configs(); let server = ServerConnection::new(sconfig).unwrap(); diff --git a/tests/badssl.rs b/tests/badssl.rs index 980f7469..a130b6c8 100644 --- a/tests/badssl.rs +++ b/tests/badssl.rs @@ -1,7 +1,7 @@ -use std::convert::TryFrom; use std::io; use std::net::ToSocketAddrs; use std::sync::Arc; + use tokio::io::{AsyncReadExt, AsyncWriteExt}; use tokio::net::TcpStream; use tokio_rustls::{ diff --git a/tests/early-data.rs b/tests/early-data.rs index 03bdfa27..9d83bcca 100644 --- a/tests/early-data.rs +++ b/tests/early-data.rs @@ -1,8 +1,5 @@ #![cfg(feature = "early-data")] -use futures_util::{future, future::Future, ready}; -use rustls::RootCertStore; -use std::convert::TryFrom; use std::io::{self, BufRead, BufReader, Cursor}; use std::net::SocketAddr; use std::pin::Pin; @@ -11,6 +8,9 @@ use std::sync::Arc; use std::task::{Context, Poll}; use std::thread; use std::time::Duration; + +use futures_util::{future, future::Future, ready}; +use rustls::RootCertStore; use tokio::io::{split, AsyncRead, AsyncWriteExt, ReadBuf}; use tokio::net::TcpStream; use tokio::sync::oneshot; diff --git a/tests/test.rs b/tests/test.rs index 0402984b..9f83db8d 100644 --- a/tests/test.rs +++ b/tests/test.rs @@ -1,14 +1,14 @@ -use futures_util::future::TryFutureExt; -use lazy_static::lazy_static; -use rustls::{ClientConfig, OwnedTrustAnchor}; -use rustls_pemfile::{certs, rsa_private_keys}; -use std::convert::TryFrom; use std::io::{BufReader, Cursor, ErrorKind}; use std::net::SocketAddr; use std::sync::mpsc::channel; use std::sync::Arc; use std::time::Duration; use std::{io, thread}; + +use futures_util::future::TryFutureExt; +use lazy_static::lazy_static; +use rustls::{ClientConfig, OwnedTrustAnchor}; +use rustls_pemfile::{certs, rsa_private_keys}; use tokio::io::{copy, split, AsyncReadExt, AsyncWriteExt}; use tokio::net::{TcpListener, TcpStream}; use tokio::sync::oneshot; @@ -164,7 +164,6 @@ async fn fail() -> io::Result<()> { #[tokio::test] async fn test_lazy_config_acceptor() -> io::Result<()> { let (sconfig, cconfig) = utils::make_configs(); - use std::convert::TryFrom; let (cstream, sstream) = tokio::io::duplex(1200); let domain = rustls::ServerName::try_from("foobar.com").unwrap();