Skip to content

Commit

Permalink
Use charlist sigil to avoid warnings in recent Elixir. (#130)
Browse files Browse the repository at this point in the history
* Replace non-interpolation ~c sigils with ~C

---------

Co-authored-by: Andrew Bruce <[email protected]>
Co-authored-by: Sergey Fedorov <[email protected]>
  • Loading branch information
3 people authored Jan 14, 2025
1 parent a2df4d8 commit 71be139
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/avrora/http_client.ex
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ defmodule Avrora.HTTPClient do
def get(url, options \\ []) do
with {:ok, headers} <- extract_headers(options),
{:ok, ssl_options} <- extract_ssl(options),
{:ok, {{_, status, _}, _, body}} <- :httpc.request(:get, {'#{url}', headers}, [ssl: ssl_options], []) do
{:ok, {{_, status, _}, _, body}} <- :httpc.request(:get, {~c(#{url}), headers}, [ssl: ssl_options], []) do
handle(status, body)
end
end
Expand All @@ -25,7 +25,7 @@ defmodule Avrora.HTTPClient do
{:ok, headers} <- extract_headers(options),
{:ok, ssl_options} <- extract_ssl(options),
{:ok, {{_, status, _}, _, body}} <-
:httpc.request(:post, {'#{url}', headers, [content_type], body}, [ssl: ssl_options], []) do
:httpc.request(:post, {~c(#{url}), headers, [content_type], body}, [ssl: ssl_options], []) do
handle(status, body)
end
end
Expand All @@ -34,12 +34,12 @@ defmodule Avrora.HTTPClient do
authorization =
case Keyword.get(options, :authorization) do
nil -> []
credentials -> [{'Authorization', '#{credentials}'}]
credentials -> [{~C(Authorization), ~c(#{credentials})}]
end

case Keyword.get(options, :user_agent) do
nil -> {:ok, authorization}
user_agent -> {:ok, [{'User-Agent', '#{user_agent}'} | authorization]}
user_agent -> {:ok, [{~C(User-Agent), ~c(#{user_agent})} | authorization]}
end
end

Expand Down

0 comments on commit 71be139

Please sign in to comment.