@@ -103,7 +103,7 @@ pub struct SslCipher {
103103}
104104
105105impl SslCipher {
106- pub fn find_by_id ( id : CipherSuite ) -> Option < & ' static SslCipher > {
106+ pub fn find_by_id ( id : CipherSuite ) -> Option < & ' static Self > {
107107 match id {
108108 CipherSuite :: TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 => {
109109 Some ( & TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 )
@@ -283,7 +283,7 @@ impl SslSession {
283283 let time_out = self . time_out . to_le_bytes ( ) ;
284284
285285 let mut ret = Vec :: with_capacity (
286- SslSession :: MAGIC . len ( )
286+ Self :: MAGIC . len ( )
287287 + id_len. len ( )
288288 + self . id . 0 . len ( )
289289 + value_len. len ( )
@@ -293,7 +293,7 @@ impl SslSession {
293293 + creation_time. len ( )
294294 + time_out. len ( ) ,
295295 ) ;
296- ret. extend_from_slice ( SslSession :: MAGIC ) ;
296+ ret. extend_from_slice ( Self :: MAGIC ) ;
297297 ret. extend_from_slice ( & id_len) ;
298298 ret. extend_from_slice ( & self . id . 0 ) ;
299299 ret. extend_from_slice ( & value_len) ;
@@ -328,8 +328,8 @@ impl SslSession {
328328 let usize_len = size_of :: < usize > ( ) ;
329329 let u64_len = size_of :: < u64 > ( ) ;
330330
331- let ( magic, slice) = split_at ( slice, SslSession :: MAGIC . len ( ) ) ?;
332- if magic != SslSession :: MAGIC {
331+ let ( magic, slice) = split_at ( slice, Self :: MAGIC . len ( ) ) ?;
332+ if magic != Self :: MAGIC {
333333 return None ;
334334 }
335335 let ( id_len, slice) = split_at ( slice, usize_len) ?;
@@ -381,7 +381,7 @@ impl SslSession {
381381 }
382382}
383383
384- impl PartialOrd < SslSession > for SslSession {
384+ impl PartialOrd < Self > for SslSession {
385385 fn partial_cmp ( & self , other : & Self ) -> Option < cmp:: Ordering > {
386386 Some ( self . id . cmp ( & other. id ) )
387387 }
@@ -393,7 +393,7 @@ impl Ord for SslSession {
393393 }
394394}
395395
396- impl PartialEq < SslSession > for SslSession {
396+ impl PartialEq < Self > for SslSession {
397397 fn eq ( & self , other : & Self ) -> bool {
398398 self . id == other. id
399399 }
@@ -478,10 +478,7 @@ impl SslContext {
478478 }
479479 }
480480
481- fn complete_construction (
482- & mut self ,
483- pointer_to_self : * mut entry:: SSL_CTX ,
484- ) -> Result < ( ) , error:: Error > {
481+ fn complete_construction ( & mut self , pointer_to_self : * mut Self ) -> Result < ( ) , error:: Error > {
485482 self . caches . set_pointer_to_owning_ssl_ctx ( pointer_to_self) ;
486483
487484 self . ex_data = ex_data:: ExData :: new_ssl_ctx ( pointer_to_self)
@@ -1549,17 +1546,17 @@ impl HandshakeState {
15491546 // nb.
15501547 // 1. openssl 3 behaviour for SSL_in_before or SSL_in_init does not match docs
15511548 // 2. SSL_in_init becomes 1 on sending a fatal alert
1552- HandshakeState :: Before
1553- | HandshakeState :: Error
1554- | HandshakeState :: ClientAwaitingServerHello
1555- | HandshakeState :: ServerAwaitingClientHello => true ,
1549+ Self :: Before
1550+ | Self :: Error
1551+ | Self :: ClientAwaitingServerHello
1552+ | Self :: ServerAwaitingClientHello => true ,
15561553 _ => false ,
15571554 }
15581555 }
15591556}
15601557
15611558impl From < HandshakeState > for c_uint {
1562- fn from ( hs : HandshakeState ) -> c_uint {
1559+ fn from ( hs : HandshakeState ) -> Self {
15631560 match hs {
15641561 HandshakeState :: Before => 0 ,
15651562 HandshakeState :: Finished => 1 ,
@@ -1603,39 +1600,39 @@ impl ShutdownFlags {
16031600 const PRIV_QUIET : i32 = 4 ;
16041601
16051602 fn is_sent ( & self ) -> bool {
1606- self . 0 & ShutdownFlags :: SENT == ShutdownFlags :: SENT
1603+ self . 0 & Self :: SENT == Self :: SENT
16071604 }
16081605
16091606 fn is_received ( & self ) -> bool {
1610- self . 0 & ShutdownFlags :: RECEIVED == ShutdownFlags :: RECEIVED
1607+ self . 0 & Self :: RECEIVED == Self :: RECEIVED
16111608 }
16121609
16131610 fn set_sent ( & mut self ) {
1614- self . 0 |= ShutdownFlags :: SENT ;
1611+ self . 0 |= Self :: SENT ;
16151612 }
16161613
16171614 fn set_received ( & mut self ) {
1618- self . 0 |= ShutdownFlags :: RECEIVED ;
1615+ self . 0 |= Self :: RECEIVED ;
16191616 }
16201617
16211618 fn set ( & mut self , flags : i32 ) {
1622- self . 0 |= flags & ShutdownFlags :: PUBLIC ;
1619+ self . 0 |= flags & Self :: PUBLIC ;
16231620 }
16241621
16251622 fn get ( & self ) -> i32 {
1626- self . 0 & ShutdownFlags :: PUBLIC
1623+ self . 0 & Self :: PUBLIC
16271624 }
16281625
16291626 fn set_quiet ( & mut self , enabled : bool ) {
16301627 if enabled {
1631- self . 0 |= ShutdownFlags :: PRIV_QUIET ;
1628+ self . 0 |= Self :: PRIV_QUIET ;
16321629 } else {
1633- self . 0 &= !ShutdownFlags :: PRIV_QUIET ;
1630+ self . 0 &= !Self :: PRIV_QUIET ;
16341631 }
16351632 }
16361633
16371634 fn quiet ( & self ) -> bool {
1638- self . 0 & ShutdownFlags :: PRIV_QUIET == ShutdownFlags :: PRIV_QUIET
1635+ self . 0 & Self :: PRIV_QUIET == Self :: PRIV_QUIET
16391636 }
16401637}
16411638
@@ -1649,20 +1646,20 @@ impl VerifyMode {
16491646 // other flags not mentioned here are not implemented.
16501647
16511648 pub fn client_must_verify_server ( & self ) -> bool {
1652- self . 0 & VerifyMode :: PEER == VerifyMode :: PEER
1649+ self . 0 & Self :: PEER == Self :: PEER
16531650 }
16541651
16551652 pub fn server_must_attempt_client_auth ( & self ) -> bool {
1656- self . 0 & VerifyMode :: PEER == VerifyMode :: PEER
1653+ self . 0 & Self :: PEER == Self :: PEER
16571654 }
16581655
16591656 pub fn server_must_verify_client ( & self ) -> bool {
1660- let bitmap = VerifyMode :: PEER | VerifyMode :: FAIL_IF_NO_PEER_CERT ;
1657+ let bitmap = Self :: PEER | Self :: FAIL_IF_NO_PEER_CERT ;
16611658 self . 0 & bitmap == bitmap
16621659 }
16631660
16641661 pub fn server_should_verify_client_but_allow_anon ( & self ) -> bool {
1665- self . 0 & ( VerifyMode :: PEER | VerifyMode :: FAIL_IF_NO_PEER_CERT ) == VerifyMode :: PEER
1662+ self . 0 & ( Self :: PEER | Self :: FAIL_IF_NO_PEER_CERT ) == Self :: PEER
16661663 }
16671664}
16681665
0 commit comments