Skip to content

Commit

Permalink
Remove list guard in Plug.Conn.merge_assigns and merge_private (#1152)
Browse files Browse the repository at this point in the history
  • Loading branch information
hissssst committed Jun 24, 2023
1 parent c30c454 commit 7b859ef
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/plug/conn.ex
Original file line number Diff line number Diff line change
Expand Up @@ -330,9 +330,9 @@ defmodule Plug.Conn do
:world
"""
@spec merge_assigns(t, Keyword.t()) :: t
def merge_assigns(%Conn{assigns: assigns} = conn, keyword) when is_list(keyword) do
%{conn | assigns: Enum.into(keyword, assigns)}
@spec merge_assigns(t, Enumerable.t()) :: t
def merge_assigns(%Conn{assigns: assigns} = conn, new) do
%{conn | assigns: Enum.into(new, assigns)}
end

@doc false
Expand Down Expand Up @@ -384,9 +384,9 @@ defmodule Plug.Conn do
:world
"""
@spec merge_private(t, Keyword.t()) :: t
def merge_private(%Conn{private: private} = conn, keyword) when is_list(keyword) do
%{conn | private: Enum.into(keyword, private)}
@spec merge_private(t, Enumerable.t()) :: t
def merge_private(%Conn{private: private} = conn, new) do
%{conn | private: Enum.into(new, private)}
end

@doc """
Expand Down

0 comments on commit 7b859ef

Please sign in to comment.