Skip to content

Commit

Permalink
chore: use Code.eval_quoted/3 instead of Module.eval_quoted/4
Browse files Browse the repository at this point in the history
Module.eval_quoted/4 will be deprecated in Elixir 1.18
  • Loading branch information
fishtreesugar committed Dec 11, 2024
1 parent f45df33 commit d47eff0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/strukt.ex
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ defmodule Strukt do
embeds: @cast_embed_fields
})

Module.eval_quoted(__ENV__, typespec_ast)
Code.eval_quoted(typespec_ast, [], __ENV__)

defp validator_builder_call(unquote(changeset), opts),
do: unquote(validate_body)
Expand Down Expand Up @@ -599,7 +599,7 @@ defmodule Strukt do

# Generate the __validate__ function
validate_ast = Strukt.Validation.generate(__MODULE__, @validated_fields)
Module.eval_quoted(__ENV__, validate_ast)
Code.eval_quoted(validate_ast, [], __ENV__)

# Handle conditional implementation of Jason.Encoder
if Module.get_attribute(__MODULE__, :derives_jason) do
Expand Down

0 comments on commit d47eff0

Please sign in to comment.