Skip to content

Commit

Permalink
fix: correctly handle multiple struct fields as input data
Browse files Browse the repository at this point in the history
  • Loading branch information
zoedsoupe committed Aug 9, 2024
1 parent 1c3652f commit 3cfe428
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/peri.ex
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ defmodule Peri do
iex> Peri.put_in_enum([], :hello, "world")
"""
def put_in_enum(enum, key, val) when is_struct(enum) do
struct(enum.__struct__, %{key => val})
struct(enum, %{key => val})
end

def put_in_enum(enum, key, val) when is_map(enum) do
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule Peri.MixProject do
use Mix.Project

@version "0.2.8"
@version "0.2.9"
@source_url "https://github.com/zoedsoupe/peri"

def project do
Expand Down

0 comments on commit 3cfe428

Please sign in to comment.