Skip to content

Commit 693bbaf

Browse files
committed
Improve code quality
1 parent e7e6eb3 commit 693bbaf

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

lib/backpex/field.ex

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -259,11 +259,8 @@ defmodule Backpex.Field do
259259
def render(%{type: :index} = assigns) do
260260
if Backpex.Field.index_editable_enabled?(assigns.field_options, assigns) do
261261
case Map.get(assigns.field_options, :render_index_form) do
262-
nil ->
263-
apply(__MODULE__, :render_index_form, [assigns])
264-
265-
func ->
266-
func.(assigns)
262+
fun when is_function(fun, 1) -> fun.(assigns)
263+
nil -> apply(__MODULE__, :render_index_form, [assigns])
267264
end
268265
else
269266
Map.get(assigns.field_options, :render, &render_value/1).(assigns)

0 commit comments

Comments
 (0)