@@ -14,7 +14,7 @@ use self::openssl::x509::{X509, X509VerifyResult};
14
14
use std:: error;
15
15
use std:: fmt;
16
16
use std:: io;
17
- use std:: sync:: { Once , ONCE_INIT } ;
17
+ use std:: sync:: Once ;
18
18
19
19
use { Protocol , TlsAcceptorBuilder , TlsConnectorBuilder } ;
20
20
use self :: openssl:: pkey:: Private ;
@@ -90,7 +90,7 @@ fn supported_protocols(
90
90
}
91
91
92
92
fn init_trust ( ) {
93
- static ONCE : Once = ONCE_INIT ;
93
+ static ONCE : Once = Once :: new ( ) ;
94
94
ONCE . call_once ( || openssl_probe:: init_ssl_cert_env_vars ( ) ) ;
95
95
}
96
96
@@ -120,17 +120,10 @@ pub enum Error {
120
120
}
121
121
122
122
impl error:: Error for Error {
123
- fn description ( & self ) -> & str {
123
+ fn source ( & self ) -> Option < & ( dyn error :: Error + ' static ) > {
124
124
match * self {
125
- Error :: Normal ( ref e) => error:: Error :: description ( e) ,
126
- Error :: Ssl ( ref e, _) => error:: Error :: description ( e) ,
127
- }
128
- }
129
-
130
- fn cause ( & self ) -> Option < & error:: Error > {
131
- match * self {
132
- Error :: Normal ( ref e) => error:: Error :: cause ( e) ,
133
- Error :: Ssl ( ref e, _) => error:: Error :: cause ( e) ,
125
+ Error :: Normal ( ref e) => error:: Error :: source ( e) ,
126
+ Error :: Ssl ( ref e, _) => error:: Error :: source ( e) ,
134
127
}
135
128
}
136
129
}
0 commit comments