Skip to content

Commit b4fd5aa

Browse files
committed
Upgrade to 2021 edition
1 parent ecc4664 commit b4fd5aa

File tree

7 files changed

+15
-17
lines changed

7 files changed

+15
-17
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ documentation = "https://docs.rs/tokio-rustls"
88
readme = "README.md"
99
description = "Asynchronous TLS/SSL streams for Tokio using Rustls."
1010
categories = ["asynchronous", "cryptography", "network-programming"]
11-
edition = "2018"
11+
edition = "2021"
1212
rust-version = "1.63"
1313

1414
[dependencies]

examples/client.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
use argh::FromArgs;
2-
use std::convert::TryFrom;
31
use std::fs::File;
42
use std::io;
53
use std::io::BufReader;
64
use std::net::ToSocketAddrs;
75
use std::path::PathBuf;
86
use std::sync::Arc;
7+
8+
use argh::FromArgs;
99
use tokio::io::{copy, split, stdin as tokio_stdin, stdout as tokio_stdout, AsyncWriteExt};
1010
use tokio::net::TcpStream;
1111
use tokio_rustls::rustls::{self, OwnedTrustAnchor};

examples/server.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
use argh::FromArgs;
2-
use rustls_pemfile::{certs, rsa_private_keys};
31
use std::fs::File;
42
use std::io::{self, BufReader};
53
use std::net::ToSocketAddrs;
64
use std::path::{Path, PathBuf};
75
use std::sync::Arc;
6+
7+
use argh::FromArgs;
8+
use rustls_pemfile::{certs, rsa_private_keys};
89
use tokio::io::{copy, sink, split, AsyncWriteExt};
910
use tokio::net::TcpListener;
1011
use tokio_rustls::rustls::{self, Certificate, PrivateKey};

src/common/test_stream.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,6 @@ async fn stream_eof() -> io::Result<()> {
279279
}
280280

281281
fn make_pair() -> (ServerConnection, ClientConnection) {
282-
use std::convert::TryFrom;
283-
284282
let (sconfig, cconfig) = utils::make_configs();
285283
let server = ServerConnection::new(sconfig).unwrap();
286284

tests/badssl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
use std::convert::TryFrom;
21
use std::io;
32
use std::net::ToSocketAddrs;
43
use std::sync::Arc;
4+
55
use tokio::io::{AsyncReadExt, AsyncWriteExt};
66
use tokio::net::TcpStream;
77
use tokio_rustls::{

tests/early-data.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
#![cfg(feature = "early-data")]
22

3-
use futures_util::{future, future::Future, ready};
4-
use rustls::RootCertStore;
5-
use std::convert::TryFrom;
63
use std::io::{self, BufRead, BufReader, Cursor};
74
use std::net::SocketAddr;
85
use std::pin::Pin;
@@ -11,6 +8,9 @@ use std::sync::Arc;
118
use std::task::{Context, Poll};
129
use std::thread;
1310
use std::time::Duration;
11+
12+
use futures_util::{future, future::Future, ready};
13+
use rustls::RootCertStore;
1414
use tokio::io::{split, AsyncRead, AsyncWriteExt, ReadBuf};
1515
use tokio::net::TcpStream;
1616
use tokio::sync::oneshot;

tests/test.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
use futures_util::future::TryFutureExt;
2-
use lazy_static::lazy_static;
3-
use rustls::{ClientConfig, OwnedTrustAnchor};
4-
use rustls_pemfile::{certs, rsa_private_keys};
5-
use std::convert::TryFrom;
61
use std::io::{BufReader, Cursor, ErrorKind};
72
use std::net::SocketAddr;
83
use std::sync::mpsc::channel;
94
use std::sync::Arc;
105
use std::time::Duration;
116
use std::{io, thread};
7+
8+
use futures_util::future::TryFutureExt;
9+
use lazy_static::lazy_static;
10+
use rustls::{ClientConfig, OwnedTrustAnchor};
11+
use rustls_pemfile::{certs, rsa_private_keys};
1212
use tokio::io::{copy, split, AsyncReadExt, AsyncWriteExt};
1313
use tokio::net::{TcpListener, TcpStream};
1414
use tokio::sync::oneshot;
@@ -164,7 +164,6 @@ async fn fail() -> io::Result<()> {
164164
#[tokio::test]
165165
async fn test_lazy_config_acceptor() -> io::Result<()> {
166166
let (sconfig, cconfig) = utils::make_configs();
167-
use std::convert::TryFrom;
168167

169168
let (cstream, sstream) = tokio::io::duplex(1200);
170169
let domain = rustls::ServerName::try_from("foobar.com").unwrap();

0 commit comments

Comments
 (0)