1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

openssl: add unsafe blocks to int -> enum blocks (#15957)

This commit is contained in:
Swastik Baranwal 2022-10-03 19:02:37 +05:30 committed by GitHub
parent dc2ba1c33f
commit 9fc64de94b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,7 +3,7 @@ module openssl
// ssl_error returns non error ssl code or error if unrecoverable and we should panic
fn ssl_error(ret int, ssl voidptr) ?SSLError {
res := C.SSL_get_error(ssl, ret)
match SSLError(res) {
match unsafe { SSLError(res) } {
.ssl_error_syscall {
return error_with_code('unrecoverable syscall ($res)', res)
}
@ -11,7 +11,7 @@ fn ssl_error(ret int, ssl voidptr) ?SSLError {
return error_with_code('unrecoverable ssl protocol error ($res)', res)
}
else {
return SSLError(res)
return unsafe { SSLError(res) }
}
}
}