Skip to content

Commit 9d1176d

Browse files
authored
Merge pull request #63 from tmccombs/edition-update
chore: Update to 2024 edition
2 parents 3adbe03 + d43b162 commit 9d1176d

File tree

7 files changed

+13
-12
lines changed

7 files changed

+13
-12
lines changed

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ description = "wrap incoming Stream of connections in TLS"
44
version = "0.11.1"
55
authors = ["Thayne McCombs <astrothayne@gmail.com>"]
66
repository = "https://github.com/tmccombs/tls-listener"
7-
edition = "2021"
7+
edition = "2024"
88
license = "Apache-2.0"
9+
rust-version = "1.85"
910

1011
[features]
1112
default = ["tokio-net"]

examples/axum.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use axum::{routing::get, Router};
1+
use axum::{Router, routing::get};
22
use std::net::SocketAddr;
33
use tls_listener::TlsListener;
44
use tokio::net::TcpListener;

examples/http-change-certificate.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
use hyper::server::conn::http1;
22
use hyper::service::service_fn;
3-
use hyper::{body::Body, Request, Response};
3+
use hyper::{Request, Response, body::Body};
44
use hyper_util::rt::tokio::TokioIo;
55
use std::convert::Infallible;
66
use std::num::NonZeroUsize;
7-
use std::sync::atomic::{AtomicU64, Ordering};
87
use std::sync::Arc;
8+
use std::sync::atomic::{AtomicU64, Ordering};
99
use tokio::net::TcpListener;
1010

1111
mod tls_config;
12-
use tls_config::{tls_acceptor, tls_acceptor2, Acceptor};
12+
use tls_config::{Acceptor, tls_acceptor, tls_acceptor2};
1313
use tokio::sync::mpsc;
1414

1515
/// To view the current certificate try:

examples/tls_config/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
mod config {
33
use std::sync::Arc;
44
use tokio_rustls::rustls::{
5-
pki_types::{CertificateDer, PrivateKeyDer},
65
ServerConfig,
6+
pki_types::{CertificateDer, PrivateKeyDer},
77
};
88

99
const CERT: &[u8] = include_bytes!("local.cert");

src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ use pin_project_lite::pin_project;
2121
#[cfg(feature = "rt")]
2222
pub use spawning_handshake::SpawningHandshakes;
2323
use std::fmt::Debug;
24-
use std::future::{poll_fn, Future};
24+
use std::future::{Future, poll_fn};
2525
use std::num::NonZeroUsize;
2626
use std::pin::Pin;
27-
use std::task::{ready, Context, Poll};
27+
use std::task::{Context, Poll, ready};
2828
use std::time::Duration;
2929
use thiserror::Error;
3030
use tokio::io::{AsyncRead, AsyncWrite};
31-
use tokio::time::{timeout, Timeout};
31+
use tokio::time::{Timeout, timeout};
3232
#[cfg(feature = "native-tls")]
3333
pub use tokio_native_tls as native_tls;
3434
#[cfg(feature = "openssl")]
@@ -48,7 +48,7 @@ pub use accept::*;
4848
mod axum;
4949

5050
/// Default number of connections to accept in a batch before trying to
51-
pub const DEFAULT_ACCEPT_BATCH_SIZE: NonZeroUsize = unsafe { NonZeroUsize::new_unchecked(64) };
51+
pub const DEFAULT_ACCEPT_BATCH_SIZE: NonZeroUsize = NonZeroUsize::new(64).unwrap();
5252
/// Default timeout for the TLS handshake.
5353
pub const DEFAULT_HANDSHAKE_TIMEOUT: Duration = Duration::from_secs(10);
5454

tests/helper/asserts.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ macro_rules! assert_err {
99
}
1010

1111
macro_rules! assert_ascii_eq {
12-
($one:expr, $two:expr) => {
12+
($one:expr, $two:expr_2021) => {
1313
assert_eq!(
1414
::std::str::from_utf8(&*$one).unwrap(),
1515
::std::str::from_utf8(&*$two).unwrap()

tests/helper/mocks.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use std::pin::Pin;
55
use std::sync::atomic::{AtomicU32, Ordering};
66
use std::task::{Context, Poll};
77
use tokio::io::{
8-
duplex, split, AsyncRead, AsyncReadExt, AsyncWrite, AsyncWriteExt, DuplexStream, ReadBuf,
8+
AsyncRead, AsyncReadExt, AsyncWrite, AsyncWriteExt, DuplexStream, ReadBuf, duplex, split,
99
};
1010
use tokio::sync::mpsc;
1111

0 commit comments

Comments
 (0)