#34 minor style change

This commit is contained in:
Yan Zhai 2019-04-22 04:08:13 +00:00
parent 87916dade6
commit 0cbd252ee4
2 changed files with 6 additions and 12 deletions

View File

@ -187,12 +187,9 @@ where
IO: AsyncRead + AsyncWrite,
{
fn shutdown(&mut self) -> Poll<(), io::Error> {
match self.state {
s if !s.writeable() => (),
_ => {
self.session.send_close_notify();
self.state.shutdown_write();
}
if self.state.writeable() {
self.session.send_close_notify();
self.state.shutdown_write();
}
let mut stream = Stream::new(&mut self.io, &mut self.session);

View File

@ -121,12 +121,9 @@ where
IO: AsyncRead + AsyncWrite,
{
fn shutdown(&mut self) -> Poll<(), io::Error> {
match self.state {
s if !s.writeable() => (),
_ => {
self.session.send_close_notify();
self.state.shutdown_write();
}
if self.state.writeable() {
self.session.send_close_notify();
self.state.shutdown_write();
}
let mut stream = Stream::new(&mut self.io, &mut self.session);