Update for attributes on match arms

This commit is contained in:
Steven Fackler 2014-04-24 23:28:20 -07:00
parent 0c1e4194f5
commit 4e54038ffc
1 changed files with 1 additions and 10 deletions

View File

@ -58,24 +58,15 @@ pub enum SslMethod {
} }
impl SslMethod { impl SslMethod {
#[cfg(sslv2)]
unsafe fn to_raw(&self) -> *ffi::SSL_METHOD { unsafe fn to_raw(&self) -> *ffi::SSL_METHOD {
match *self { match *self {
#[cfg(sslv2)]
Sslv2 => ffi::SSLv2_method(), Sslv2 => ffi::SSLv2_method(),
Sslv3 => ffi::SSLv3_method(), Sslv3 => ffi::SSLv3_method(),
Tlsv1 => ffi::TLSv1_method(), Tlsv1 => ffi::TLSv1_method(),
Sslv23 => ffi::SSLv23_method() Sslv23 => ffi::SSLv23_method()
} }
} }
#[cfg(not(sslv2))]
unsafe fn to_raw(&self) -> *ffi::SSL_METHOD {
match *self {
Sslv3 => ffi::SSLv3_method(),
Tlsv1 => ffi::TLSv1_method(),
Sslv23 => ffi::SSLv23_method()
}
}
} }
/// Determines the type of certificate verification used /// Determines the type of certificate verification used