Skip to content

Commit

Permalink
Move conditional to compile time
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim committed May 28, 2024
1 parent 9317369 commit 9203382
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions lib/adbc_helper.ex
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,13 @@ defmodule Adbc.Helper do
end
end

defp otp_cacerts do
if System.otp_release() >= "25" do
# cacerts_get/0 raises if no certs found
try do
:public_key.cacerts_get()
rescue
_ ->
nil
end
if System.otp_release() >= "25" do
defp otp_cacerts do
:public_key.cacerts_get()
rescue
_ -> nil
end
else
defp otp_cacerts, do: nil
end
end

0 comments on commit 9203382

Please sign in to comment.