Skip to content

Commit 8ce9b65

Browse files
committed
Apply suggestions from clippy 1.89
1 parent 73b8a49 commit 8ce9b65

File tree

1 file changed

+1
-24
lines changed

1 file changed

+1
-24
lines changed

tests/early-data.rs

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,16 @@
22

33
use std::io::{self, Read, Write};
44
use std::net::{SocketAddr, TcpListener};
5-
use std::pin::Pin;
65
use std::sync::Arc;
7-
use std::task::{Context, Poll};
86
use std::thread;
97

10-
use futures_util::{future::Future, ready};
118
use rustls::pki_types::ServerName;
129
use rustls::{self, ClientConfig, ServerConnection, Stream};
13-
use tokio::io::{AsyncRead, AsyncReadExt, AsyncWrite, AsyncWriteExt, ReadBuf};
10+
use tokio::io::{AsyncRead, AsyncReadExt, AsyncWrite, AsyncWriteExt};
1411
use tokio::net::TcpStream;
1512
use tokio_rustls::client::TlsStream;
1613
use tokio_rustls::TlsConnector;
1714

18-
struct Read1<T>(T);
19-
20-
impl<T: AsyncRead + Unpin> Future for Read1<T> {
21-
type Output = io::Result<()>;
22-
23-
fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
24-
let mut buf = [0];
25-
let mut buf = ReadBuf::new(&mut buf);
26-
27-
ready!(Pin::new(&mut self.0).poll_read(cx, &mut buf))?;
28-
29-
if buf.filled().is_empty() {
30-
Poll::Ready(Ok(()))
31-
} else {
32-
cx.waker().wake_by_ref();
33-
Poll::Pending
34-
}
35-
}
36-
}
37-
3815
async fn send<S: AsyncRead + AsyncWrite + Unpin>(
3916
config: Arc<ClientConfig>,
4017
addr: SocketAddr,

0 commit comments

Comments
 (0)