Skip to content

Commit 279d8a5

Browse files
committed
credo: with -> case
1 parent 9cb2593 commit 279d8a5

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

lib/scenic/graph/compiler.ex

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -156,19 +156,21 @@ defmodule Scenic.Graph.Compiler do
156156
defp compile_styles(desired, %Compiler{} = state) when is_list(desired) do
157157
Enum.reduce(desired, {[], state}, fn k, {ops, state} ->
158158
# if not requested, there is no style to compile...
159-
with {:ok, req} <- fetch_req(state, k) do
160-
case fetch_set(state, k) do
161-
{:ok, ^req} ->
162-
# Nothing to do. The correct style is already set
163-
{ops, state}
164-
165-
_ ->
166-
# Whatever is set (or not) is different than what is requested
167-
{compile_style(ops, {k, req}), put_set(state, k, req)}
168-
end
169-
else
159+
case fetch_req(state, k) do
160+
{:ok, req} ->
161+
case fetch_set(state, k) do
162+
{:ok, ^req} ->
163+
# Nothing to do. The correct style is already set
164+
{ops, state}
165+
166+
_ ->
167+
# Whatever is set (or not) is different than what is requested
168+
{compile_style(ops, {k, req}), put_set(state, k, req)}
169+
end
170+
170171
# not requested at all case
171-
_ -> {ops, state}
172+
_ ->
173+
{ops, state}
172174
end
173175
end)
174176
end

0 commit comments

Comments
 (0)