From c437be5a2751b2e45ce11b84e3764690d8c32654 Mon Sep 17 00:00:00 2001 From: Matthew Date: Fri, 15 Mar 2024 13:45:46 +0000 Subject: [PATCH 1/2] Make sure imports in examples use re-exported rustls types --- examples/client.rs | 1 + examples/server.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/examples/client.rs b/examples/client.rs index ed2ba963..7a7708b1 100644 --- a/examples/client.rs +++ b/examples/client.rs @@ -8,6 +8,7 @@ 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; use tokio_rustls::TlsConnector; /// Tokio Rustls client example diff --git a/examples/server.rs b/examples/server.rs index a2a0bc4a..cf82d985 100644 --- a/examples/server.rs +++ b/examples/server.rs @@ -9,6 +9,7 @@ use pki_types::{CertificateDer, PrivateKeyDer}; use rustls_pemfile::{certs, rsa_private_keys}; use tokio::io::{copy, sink, split, AsyncWriteExt}; use tokio::net::TcpListener; +use tokio_rustls::rustls; use tokio_rustls::TlsAcceptor; /// Tokio Rustls server example From 51db68dd267e8250aed02c058415c8b5bf5f71d7 Mon Sep 17 00:00:00 2001 From: Matthew Date: Fri, 15 Mar 2024 14:22:12 +0000 Subject: [PATCH 2/2] Merged use lines, as per code review suggestion --- examples/client.rs | 3 +-- examples/server.rs | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/examples/client.rs b/examples/client.rs index 7a7708b1..87abec77 100644 --- a/examples/client.rs +++ b/examples/client.rs @@ -8,8 +8,7 @@ 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; -use tokio_rustls::TlsConnector; +use tokio_rustls::{rustls, TlsConnector}; /// Tokio Rustls client example #[derive(FromArgs)] diff --git a/examples/server.rs b/examples/server.rs index cf82d985..741d2cd1 100644 --- a/examples/server.rs +++ b/examples/server.rs @@ -9,8 +9,7 @@ use pki_types::{CertificateDer, PrivateKeyDer}; use rustls_pemfile::{certs, rsa_private_keys}; use tokio::io::{copy, sink, split, AsyncWriteExt}; use tokio::net::TcpListener; -use tokio_rustls::rustls; -use tokio_rustls::TlsAcceptor; +use tokio_rustls::{rustls, TlsAcceptor}; /// Tokio Rustls server example #[derive(FromArgs)]