Skip to content

Commit e8ea6d0

Browse files
committed
Drop unused return values of TlsListener::configure and TlsListener::connect
These methods return the TlsAcceptor and TcpListener, respectively, but the only caller ignores those return values.
1 parent ea41f9f commit e8ea6d0

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

src/tls_listener.rs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ impl<State> TlsListener<State> {
6969
TlsListenerBuilder::new()
7070
}
7171

72-
async fn configure(&mut self) -> io::Result<TlsAcceptor> {
72+
async fn configure(&mut self) -> io::Result<()> {
7373
self.config = match std::mem::take(&mut self.config) {
7474
TlsListenerConfig::Paths { cert, key } => {
7575
let certs = load_certs(&cert)?;
@@ -89,8 +89,8 @@ impl<State> TlsListener<State> {
8989
other => other,
9090
};
9191

92-
if let TlsListenerConfig::Acceptor(ref a) = self.config {
93-
Ok(a.clone())
92+
if let TlsListenerConfig::Acceptor(_) = self.config {
93+
Ok(())
9494
} else {
9595
Err(io::Error::new(
9696
io::ErrorKind::Other,
@@ -113,17 +113,12 @@ impl<State> TlsListener<State> {
113113
}
114114
}
115115

116-
async fn connect(&mut self) -> io::Result<&TcpListener> {
116+
async fn connect(&mut self) -> io::Result<()> {
117117
if let TcpConnection::Addrs(addrs) = &self.connection {
118118
let tcp = TcpListener::bind(&addrs[..]).await?;
119119
self.connection = TcpConnection::Connected(tcp);
120120
}
121-
122-
if let TcpConnection::Connected(tcp) = &self.connection {
123-
Ok(tcp)
124-
} else {
125-
unreachable!()
126-
}
121+
Ok(())
127122
}
128123
}
129124

0 commit comments

Comments
 (0)