Skip to content

Commit f6ad9f5

Browse files
committed
fix: Remove unreachable error pattern and superfluous type spec
- Remove unreachable {:error, _} pattern in result case statement - Remove redundant iodata_to_charlist @SPEC (type inference sufficient) - handle_response throws instead of returning errors
1 parent c516781 commit f6ad9f5

File tree

2 files changed

+0
-5
lines changed

2 files changed

+0
-5
lines changed

lib/http.ex

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -426,10 +426,6 @@ defmodule HTTP do
426426
%Response{status: status} ->
427427
# Streaming response - we'll emit telemetry when streaming completes
428428
HTTP.Telemetry.request_stop(status, request.url, 0, duration)
429-
430-
{:error, _} ->
431-
# Error will be handled in catch block
432-
:ok
433429
end
434430

435431
result

lib/http/request.ex

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@ defmodule HTTP.Request do
147147
# Efficiently converts iodata (nested list of binaries) to charlist
148148
# This is used for multipart form data to minimize intermediate copies
149149
# The iodata structure is flattened once instead of concatenating strings multiple times
150-
@spec iodata_to_charlist(binary() | iodata()) :: charlist()
151150
defp iodata_to_charlist(iodata) do
152151
iodata
153152
|> IO.iodata_to_binary()

0 commit comments

Comments
 (0)