From 0cbd252ee49beb90ce60c22540128e36518ab6e0 Mon Sep 17 00:00:00 2001 From: Yan Zhai Date: Mon, 22 Apr 2019 04:08:13 +0000 Subject: [PATCH] #34 minor style change --- src/client.rs | 9 +++------ src/server.rs | 9 +++------ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/client.rs b/src/client.rs index 9961503..616c151 100644 --- a/src/client.rs +++ b/src/client.rs @@ -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); diff --git a/src/server.rs b/src/server.rs index e6f5701..1568414 100644 --- a/src/server.rs +++ b/src/server.rs @@ -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);