Skip to content

Commit 03ba022

Browse files
committed
Don't use the matches!() macro
1 parent 72f7cd6 commit 03ba022

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

vm/src/stdlib/ssl.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ mod sys {
3838
}
3939
}
4040

41-
#[derive(num_enum::IntoPrimitive, num_enum::TryFromPrimitive)]
41+
#[derive(num_enum::IntoPrimitive, num_enum::TryFromPrimitive, PartialEq)]
4242
#[repr(i32)]
4343
enum SslVersion {
4444
Ssl2,
@@ -58,7 +58,7 @@ enum CertRequirements {
5858
Required,
5959
}
6060

61-
#[derive(Debug)]
61+
#[derive(Debug, PartialEq)]
6262
enum SslServerOrClient {
6363
Client,
6464
Server,
@@ -192,7 +192,7 @@ impl PySslContext {
192192
};
193193
let mut builder =
194194
SslContextBuilder::new(method).map_err(|e| convert_openssl_error(vm, e))?;
195-
let check_hostname = matches!(proto, SslVersion::TlsClient);
195+
let check_hostname = proto == SslVersion::TlsClient;
196196
builder.set_verify(if check_hostname {
197197
SslVerifyMode::PEER | SslVerifyMode::FAIL_IF_NO_PEER_CERT
198198
} else {
@@ -420,7 +420,7 @@ impl PySslSocket {
420420
}
421421
#[pyproperty]
422422
fn server_side(&self) -> bool {
423-
matches!(self.socket_type, SslServerOrClient::Server)
423+
self.socket_type == SslServerOrClient::Server
424424
}
425425
#[pyproperty]
426426
fn context(&self) -> PyRef<PySslContext> {

0 commit comments

Comments
 (0)