Skip to content

Commit 71be139

Browse files
sstoltzecamelpunchStrech
authored
Use charlist sigil to avoid warnings in recent Elixir. (#130)
* Replace non-interpolation ~c sigils with ~C --------- Co-authored-by: Andrew Bruce <andrew.bruce@maersk.com> Co-authored-by: Sergey Fedorov <oni.strech@gmail.com>
1 parent a2df4d8 commit 71be139

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/avrora/http_client.ex

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ defmodule Avrora.HTTPClient do
1212
def get(url, options \\ []) do
1313
with {:ok, headers} <- extract_headers(options),
1414
{:ok, ssl_options} <- extract_ssl(options),
15-
{:ok, {{_, status, _}, _, body}} <- :httpc.request(:get, {'#{url}', headers}, [ssl: ssl_options], []) do
15+
{:ok, {{_, status, _}, _, body}} <- :httpc.request(:get, {~c(#{url}), headers}, [ssl: ssl_options], []) do
1616
handle(status, body)
1717
end
1818
end
@@ -25,7 +25,7 @@ defmodule Avrora.HTTPClient do
2525
{:ok, headers} <- extract_headers(options),
2626
{:ok, ssl_options} <- extract_ssl(options),
2727
{:ok, {{_, status, _}, _, body}} <-
28-
:httpc.request(:post, {'#{url}', headers, [content_type], body}, [ssl: ssl_options], []) do
28+
:httpc.request(:post, {~c(#{url}), headers, [content_type], body}, [ssl: ssl_options], []) do
2929
handle(status, body)
3030
end
3131
end
@@ -34,12 +34,12 @@ defmodule Avrora.HTTPClient do
3434
authorization =
3535
case Keyword.get(options, :authorization) do
3636
nil -> []
37-
credentials -> [{'Authorization', '#{credentials}'}]
37+
credentials -> [{~C(Authorization), ~c(#{credentials})}]
3838
end
3939

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

0 commit comments

Comments
 (0)