Fix one clippy::unneeded_unwrap warning

This commit is contained in:
Dmitry Bogatov
2019-08-28 00:01:09 +00:00
parent ea964fd733
commit 2d00495d29

View File

@@ -479,14 +479,12 @@ impl Imap {
0, "IMAP unsetup_handle step 1 (closing down stream)." 0, "IMAP unsetup_handle step 1 (closing down stream)."
); );
let stream = self.stream.write().unwrap().take(); let stream = self.stream.write().unwrap().take();
if stream.is_some() { if let Some(stream) = stream {
match stream.unwrap().shutdown(net::Shutdown::Both) { if let Err(err) = stream.shutdown(net::Shutdown::Both) {
Ok(_) => {} eprintln!("failed to shutdown connection: {:?}", err);
Err(err) => {
eprintln!("failed to shutdown connection: {:?}", err);
}
} }
} }
info!( info!(
context, context,
0, "IMAP unsetup_handle step 2 (acquiring session.lock)" 0, "IMAP unsetup_handle step 2 (acquiring session.lock)"