I want to know the optimized code for the following case condition.
case job_opening.state == :public do
true ->
result = job.test_req
case result do
{:ok, _} ->
#same_good_cond
{:error, _} ->
#same_bad_cond
end
false ->
#same_good_cond
end
end
I don’t want to repeat code. Is there any way? Your response will be highly appreciable.