3636//!
3737//! see <https://github.com/tokio-rs/tls/issues/41>
3838
39- #![ warn( unreachable_pub) ]
39+ #![ warn( unreachable_pub, clippy :: use_self ) ]
4040
4141use std:: io;
4242#[ cfg( unix) ]
@@ -150,8 +150,8 @@ where
150150 buf : & mut ReadBuf < ' _ > ,
151151 ) -> Poll < io:: Result < ( ) > > {
152152 match self . get_mut ( ) {
153- TlsStream :: Client ( x) => Pin :: new ( x) . poll_read ( cx, buf) ,
154- TlsStream :: Server ( x) => Pin :: new ( x) . poll_read ( cx, buf) ,
153+ Self :: Client ( x) => Pin :: new ( x) . poll_read ( cx, buf) ,
154+ Self :: Server ( x) => Pin :: new ( x) . poll_read ( cx, buf) ,
155155 }
156156 }
157157}
@@ -163,16 +163,16 @@ where
163163 #[ inline]
164164 fn poll_fill_buf ( self : Pin < & mut Self > , cx : & mut Context < ' _ > ) -> Poll < io:: Result < & [ u8 ] > > {
165165 match self . get_mut ( ) {
166- TlsStream :: Client ( x) => Pin :: new ( x) . poll_fill_buf ( cx) ,
167- TlsStream :: Server ( x) => Pin :: new ( x) . poll_fill_buf ( cx) ,
166+ Self :: Client ( x) => Pin :: new ( x) . poll_fill_buf ( cx) ,
167+ Self :: Server ( x) => Pin :: new ( x) . poll_fill_buf ( cx) ,
168168 }
169169 }
170170
171171 #[ inline]
172172 fn consume ( self : Pin < & mut Self > , amt : usize ) {
173173 match self . get_mut ( ) {
174- TlsStream :: Client ( x) => Pin :: new ( x) . consume ( amt) ,
175- TlsStream :: Server ( x) => Pin :: new ( x) . consume ( amt) ,
174+ Self :: Client ( x) => Pin :: new ( x) . consume ( amt) ,
175+ Self :: Server ( x) => Pin :: new ( x) . consume ( amt) ,
176176 }
177177 }
178178}
@@ -188,8 +188,8 @@ where
188188 buf : & [ u8 ] ,
189189 ) -> Poll < io:: Result < usize > > {
190190 match self . get_mut ( ) {
191- TlsStream :: Client ( x) => Pin :: new ( x) . poll_write ( cx, buf) ,
192- TlsStream :: Server ( x) => Pin :: new ( x) . poll_write ( cx, buf) ,
191+ Self :: Client ( x) => Pin :: new ( x) . poll_write ( cx, buf) ,
192+ Self :: Server ( x) => Pin :: new ( x) . poll_write ( cx, buf) ,
193193 }
194194 }
195195
@@ -200,32 +200,32 @@ where
200200 bufs : & [ io:: IoSlice < ' _ > ] ,
201201 ) -> Poll < io:: Result < usize > > {
202202 match self . get_mut ( ) {
203- TlsStream :: Client ( x) => Pin :: new ( x) . poll_write_vectored ( cx, bufs) ,
204- TlsStream :: Server ( x) => Pin :: new ( x) . poll_write_vectored ( cx, bufs) ,
203+ Self :: Client ( x) => Pin :: new ( x) . poll_write_vectored ( cx, bufs) ,
204+ Self :: Server ( x) => Pin :: new ( x) . poll_write_vectored ( cx, bufs) ,
205205 }
206206 }
207207
208208 #[ inline]
209209 fn is_write_vectored ( & self ) -> bool {
210210 match self {
211- TlsStream :: Client ( x) => x. is_write_vectored ( ) ,
212- TlsStream :: Server ( x) => x. is_write_vectored ( ) ,
211+ Self :: Client ( x) => x. is_write_vectored ( ) ,
212+ Self :: Server ( x) => x. is_write_vectored ( ) ,
213213 }
214214 }
215215
216216 #[ inline]
217217 fn poll_flush ( self : Pin < & mut Self > , cx : & mut Context < ' _ > ) -> Poll < io:: Result < ( ) > > {
218218 match self . get_mut ( ) {
219- TlsStream :: Client ( x) => Pin :: new ( x) . poll_flush ( cx) ,
220- TlsStream :: Server ( x) => Pin :: new ( x) . poll_flush ( cx) ,
219+ Self :: Client ( x) => Pin :: new ( x) . poll_flush ( cx) ,
220+ Self :: Server ( x) => Pin :: new ( x) . poll_flush ( cx) ,
221221 }
222222 }
223223
224224 #[ inline]
225225 fn poll_shutdown ( self : Pin < & mut Self > , cx : & mut Context < ' _ > ) -> Poll < io:: Result < ( ) > > {
226226 match self . get_mut ( ) {
227- TlsStream :: Client ( x) => Pin :: new ( x) . poll_shutdown ( cx) ,
228- TlsStream :: Server ( x) => Pin :: new ( x) . poll_shutdown ( cx) ,
227+ Self :: Client ( x) => Pin :: new ( x) . poll_shutdown ( cx) ,
228+ Self :: Server ( x) => Pin :: new ( x) . poll_shutdown ( cx) ,
229229 }
230230 }
231231}
0 commit comments