Skip to content

Commit 7b859ef

Browse files
authored
Remove list guard in Plug.Conn.merge_assigns and merge_private (#1152)
1 parent c30c454 commit 7b859ef

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lib/plug/conn.ex

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -330,9 +330,9 @@ defmodule Plug.Conn do
330330
:world
331331
332332
"""
333-
@spec merge_assigns(t, Keyword.t()) :: t
334-
def merge_assigns(%Conn{assigns: assigns} = conn, keyword) when is_list(keyword) do
335-
%{conn | assigns: Enum.into(keyword, assigns)}
333+
@spec merge_assigns(t, Enumerable.t()) :: t
334+
def merge_assigns(%Conn{assigns: assigns} = conn, new) do
335+
%{conn | assigns: Enum.into(new, assigns)}
336336
end
337337

338338
@doc false
@@ -384,9 +384,9 @@ defmodule Plug.Conn do
384384
:world
385385
386386
"""
387-
@spec merge_private(t, Keyword.t()) :: t
388-
def merge_private(%Conn{private: private} = conn, keyword) when is_list(keyword) do
389-
%{conn | private: Enum.into(keyword, private)}
387+
@spec merge_private(t, Enumerable.t()) :: t
388+
def merge_private(%Conn{private: private} = conn, new) do
389+
%{conn | private: Enum.into(new, private)}
390390
end
391391

392392
@doc """

0 commit comments

Comments
 (0)