Skip to content

Commit

Permalink
Upgrade to 2021 edition
Browse files Browse the repository at this point in the history
  • Loading branch information
djc committed Aug 11, 2023
1 parent ecc4664 commit b4fd5aa
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
4 changes: 2 additions & 2 deletions examples/client.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand Down
5 changes: 3 additions & 2 deletions examples/server.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand Down
2 changes: 0 additions & 2 deletions src/common/test_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion tests/badssl.rs
Original file line number Diff line number Diff line change
@@ -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::{
Expand Down
6 changes: 3 additions & 3 deletions tests/early-data.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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;
Expand Down
11 changes: 5 additions & 6 deletions tests/test.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit b4fd5aa

Please sign in to comment.