refactor(client): Replacing manual unwrap with match statement

This commit is contained in:
David Raifaizen
2016-05-06 20:47:03 -04:00
parent a8324795e5
commit 4f4a1436ae

View File

@@ -80,10 +80,9 @@ impl<S: Connector + Write + Read + Debug + Clone> Client<S> {
/// Upgrades the underlying connection to SSL/TLS
pub fn upgrade_tls_stream(&mut self, ssl_context: &SslContext) -> io::Result<()> {
if self.stream.is_some() {
self.stream.as_mut().unwrap().get_mut().upgrade_tls(ssl_context)
} else {
Ok(())
match self.stream {
Some(ref mut stream) => stream.get_mut().upgrade_tls(ssl_context),
None => Ok(())
}
}