Skip to content

Commit a447199

Browse files
committed
Fix warnings on Elixir v1.20
1 parent fb3e156 commit a447199

1 file changed

Lines changed: 2 additions & 14 deletions

File tree

lib/plug/parsers/multipart.ex

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ defmodule Plug.Parsers.MULTIPART do
226226

227227
defp parse_multipart_file({:more, tail, conn}, limit, opts, file)
228228
when limit >= byte_size(tail) do
229-
binwrite!(file, tail)
229+
IO.binwrite(file, tail)
230230
read_result = Plug.Conn.read_part_body(conn, opts)
231231
parse_multipart_file(read_result, limit - byte_size(tail), opts, file)
232232
end
@@ -237,7 +237,7 @@ defmodule Plug.Parsers.MULTIPART do
237237

238238
defp parse_multipart_file({:ok, tail, conn}, limit, _opts, file)
239239
when limit >= byte_size(tail) do
240-
binwrite!(file, tail)
240+
IO.binwrite(file, tail)
241241
{:ok, limit - byte_size(tail), conn}
242242
end
243243

@@ -247,18 +247,6 @@ defmodule Plug.Parsers.MULTIPART do
247247

248248
## Helpers
249249

250-
defp binwrite!(device, contents) do
251-
case IO.binwrite(device, contents) do
252-
:ok ->
253-
:ok
254-
255-
{:error, reason} ->
256-
raise Plug.UploadError,
257-
"could not write to file #{inspect(device)} during upload " <>
258-
"due to reason: #{inspect(reason)}"
259-
end
260-
end
261-
262250
defp multipart_type(headers) do
263251
with {_, disposition} <- List.keyfind(headers, "content-disposition", 0),
264252
[_, params] <- :binary.split(disposition, ";"),

0 commit comments

Comments
 (0)