From 7b859ef85ede3154ff39249f0310064654d896e3 Mon Sep 17 00:00:00 2001 From: Hissssst <37012324+hissssst@users.noreply.github.com> Date: Sun, 25 Jun 2023 01:50:54 +0400 Subject: [PATCH] Remove list guard in Plug.Conn.merge_assigns and merge_private (#1152) --- lib/plug/conn.ex | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/plug/conn.ex b/lib/plug/conn.ex index a027b745..9d3fe57f 100644 --- a/lib/plug/conn.ex +++ b/lib/plug/conn.ex @@ -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 @@ -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 """