I need your opinion,
as suppose this construction duplicate same close action for both IOStream
(references)
pub fn close(&self, cancellable: Option<&Cancellable>) -> Result<(), Error> {
if let Some(ref tls_client_connection) = self.tls_client_connection {
if !tls_client_connection.is_closed() {
if let Err(reason) = tls_client_connection.close(cancellable) {
return Err(Error::TlsClientConnection(reason));
}
// maybe no sense to continue on this condition match?
}
}
if !self.socket_connection.is_closed() {
if let Err(reason) = self.socket_connection.close(cancellable) {
return Err(Error::SocketConnection(reason));
}
}
Ok(())
}
Thanks