From 80ca26b584cd1cea3046c315a0e23a1106da7d77 Mon Sep 17 00:00:00 2001 From: Jechol Lee Date: Mon, 29 Apr 2024 23:39:47 +0900 Subject: [PATCH] Fix Spark.InfoGenerator --- lib/spark/info_generator.ex | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/spark/info_generator.ex b/lib/spark/info_generator.ex index e604e98..8e5bfb5 100644 --- a/lib/spark/info_generator.ex +++ b/lib/spark/info_generator.ex @@ -201,15 +201,15 @@ defmodule Spark.InfoGenerator do if unquote(is_nil(option.default)) do def unquote(option.function_name)(dsl_or_extended) do - import Spark.Dsl.Extension, only: [get_opt: 3] + import Spark.Dsl.Extension, only: [fetch_opt: 3] - case get_opt( + case fetch_opt( dsl_or_extended, unquote(option.path), unquote(option.name) ) do :error -> :error - value -> {:ok, value} + {:ok, value} -> {:ok, value} end end else @@ -222,7 +222,7 @@ defmodule Spark.InfoGenerator do unquote(option.name) ) do :error -> {:ok, unquote(option.default)} - value -> {:ok, value} + {:ok, value} -> {:ok, value} end end end @@ -244,7 +244,7 @@ defmodule Spark.InfoGenerator do on = get_persisted(dsl_or_extended, :module) raise "No configuration for `#{unquote(option.name)}` present on #{inspect(on)}" - value -> + {:ok, value} -> value end end @@ -260,7 +260,7 @@ defmodule Spark.InfoGenerator do :error -> unquote(option.default) - value -> + {:ok, value} -> value end end