@@ -14,7 +14,7 @@ use self::openssl::x509::{X509, X509VerifyResult};
1414use std:: error;
1515use std:: fmt;
1616use std:: io;
17- use std:: sync:: { Once , ONCE_INIT } ;
17+ use std:: sync:: Once ;
1818
1919use { Protocol , TlsAcceptorBuilder , TlsConnectorBuilder } ;
2020use self :: openssl:: pkey:: Private ;
@@ -90,7 +90,7 @@ fn supported_protocols(
9090}
9191
9292fn init_trust ( ) {
93- static ONCE : Once = ONCE_INIT ;
93+ static ONCE : Once = Once :: new ( ) ;
9494 ONCE . call_once ( || openssl_probe:: init_ssl_cert_env_vars ( ) ) ;
9595}
9696
@@ -120,17 +120,10 @@ pub enum Error {
120120}
121121
122122impl error:: Error for Error {
123- fn description ( & self ) -> & str {
123+ fn source ( & self ) -> Option < & ( dyn error :: Error + ' static ) > {
124124 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) ,
134127 }
135128 }
136129}
0 commit comments