Skip to content

Commit

Permalink
Run 'mix format'
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianbrink committed Jul 10, 2023
1 parent 8bafed2 commit 6495524
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/tesla/adapter/hackney.ex
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ if Code.ensure_loaded?(:hackney) do
end

defp request(method, url, headers, body, opts) do
handle(:hackney.request(method, url, headers, body || '', opts), opts)
handle(:hackney.request(method, url, headers, body || ~c"", opts), opts)
end

defp request_stream(method, url, headers, body, opts) do
Expand Down
4 changes: 2 additions & 2 deletions lib/tesla/adapter/httpc.ex
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ defmodule Tesla.Adapter.Httpc do
headers = for {key, value} <- headers, do: {to_charlist(key), to_charlist(value)}

{content_type, headers} =
case List.keytake(headers, 'content-type', 0) do
nil -> {'text/plain', headers}
case List.keytake(headers, ~c"content-type", 0) do
nil -> {~c"text/plain", headers}
{{_, ct}, headers} -> {ct, headers}
end

Expand Down
4 changes: 2 additions & 2 deletions lib/tesla/middleware.ex
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ defmodule Tesla.Middleware do
Tesla.client([{Tesla.Middleware.BaseUrl, "https://example.com"}])
## Ordering
The order in which middleware is defined matters. Note that the order when _sending_ the request
matches the order the middleware was defined in, but the order when _receiving_ the response
is reversed.
For example, `Tesla.Middleware.DecompressResponse` must come _after_ `Tesla.Middleware.JSON`,
otherwise the response isn't decompressed before it reaches the JSON parser.
Expand Down
2 changes: 1 addition & 1 deletion test/tesla/adapter/gun_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ defmodule Tesla.Adapter.GunTest do
}

assert {:error, "socks protocol is not supported"} ==
call(request, proxy: {:socks5, 'localhost', 1234})
call(request, proxy: {:socks5, ~c"localhost", 1234})
end

test "receive gun_up message when receive is false" do
Expand Down
4 changes: 2 additions & 2 deletions test/tesla/middleware/timeout_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ defmodule Tesla.Middleware.TimeoutTest do
[{last_module, _, _, file_info} | _] = __STACKTRACE__

assert Tesla.Middleware.TimeoutTest.Client == last_module
assert file_info[:file] == 'lib/tesla/builder.ex'
assert file_info[:file] == ~c"lib/tesla/builder.ex"
assert file_info[:line] == 23
else
_ ->
Expand All @@ -131,7 +131,7 @@ defmodule Tesla.Middleware.TimeoutTest do
[_, {timeout_module, _, _, module_file_info} | _] = __STACKTRACE__

assert Tesla.Middleware.Timeout == timeout_module
assert module_file_info == [file: 'lib/tesla/middleware/timeout.ex', line: 59]
assert module_file_info == [file: ~c"lib/tesla/middleware/timeout.ex", line: 59]
else
_ ->
flunk("Expected exception to be thrown")
Expand Down

0 comments on commit 6495524

Please sign in to comment.