From d47eff084b998506933b4bc53695dac2ce03c142 Mon Sep 17 00:00:00 2001 From: fishtreesugar Date: Tue, 10 Dec 2024 19:10:13 -0600 Subject: [PATCH] chore: use `Code.eval_quoted/3` instead of `Module.eval_quoted/4` Module.eval_quoted/4 will be deprecated in Elixir 1.18 --- lib/strukt.ex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/strukt.ex b/lib/strukt.ex index 7538e19..f2ee863 100644 --- a/lib/strukt.ex +++ b/lib/strukt.ex @@ -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) @@ -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