Skip to content

Commit

Permalink
Fix warnings on latest Elixir
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim committed Oct 31, 2023
1 parent f9ceeaf commit 6856d5b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions lib/mix/tasks/phx.gen.cert.ex
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ defmodule Mix.Tasks.Phx.Gen.Cert do
@doc false
def run(all_args) do
if Mix.Project.umbrella?() do
Mix.raise("mix phx.gen.cert must be invoked from within your *_web application root directory")
Mix.raise(
"mix phx.gen.cert must be invoked from within your *_web application root directory"
)
end

{opts, args} =
Expand Down Expand Up @@ -255,8 +257,8 @@ defmodule Mix.Tasks.Phx.Gen.Cert do
issuer: rdn(common_name),
validity:
validity(
notBefore: {:utcTime, '#{not_before}000000Z'},
notAfter: {:utcTime, '#{not_after}000000Z'}
notBefore: {:utcTime, ~c"#{not_before}000000Z"},
notAfter: {:utcTime, ~c"#{not_after}000000Z"}
),
subject: rdn(common_name),
subjectPublicKeyInfo:
Expand Down
2 changes: 1 addition & 1 deletion lib/phoenix/endpoint/supervisor.ex
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ defmodule Phoenix.Endpoint.Supervisor do
end

defp socket_children(endpoint, fun) do
for {_, socket, opts} <- Enum.uniq_by(endpoint.__sockets__, &elem(&1, 1)),
for {_, socket, opts} <- Enum.uniq_by(endpoint.__sockets__(), &elem(&1, 1)),
spec = apply_or_ignore(socket, fun, [[endpoint: endpoint] ++ opts]),
spec != :ignore do
spec
Expand Down
2 changes: 1 addition & 1 deletion test/mix/tasks/phx.gen.cert_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ defmodule Mix.Tasks.Phx.CertTest do

# We don't actually verify the server cert contents, we just check that
# the client and server are able to complete the TLS handshake
assert {:ok, client} = :ssl.connect('localhost', port, [verify: :verify_none], @timeout)
assert {:ok, client} = :ssl.connect(~c"localhost", port, [verify: :verify_none], @timeout)
:ssl.close(client)
:ssl.close(server)
end)
Expand Down

0 comments on commit 6856d5b

Please sign in to comment.