fix: reworking some code smell issues
This commit is contained in:
@@ -312,7 +312,7 @@ defmodule BDS.Desktop.ShellLive.SettingsEditor.AISettings do
|
||||
defp normalize_endpoint_result({:ok, _endpoint}), do: :ok
|
||||
defp normalize_endpoint_result({:error, reason}), do: {:error, reason}
|
||||
|
||||
defp truthy?(value), do: value in [true, "true", "on", "1", 1]
|
||||
defp truthy?(value), do: BDS.Values.truthy?(value)
|
||||
|
||||
defp blank_to_nil(nil), do: nil
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ defmodule BDS.Desktop.ShellLive.SettingsEditor.EditorSettings do
|
||||
}
|
||||
end
|
||||
|
||||
defp truthy?(value), do: value in [true, "true", "on", "1", 1]
|
||||
defp truthy?(value), do: BDS.Values.truthy?(value)
|
||||
defp boolean_string(true), do: "true"
|
||||
defp boolean_string(false), do: "false"
|
||||
end
|
||||
|
||||
@@ -187,7 +187,7 @@ defmodule BDS.Desktop.ShellLive.SettingsEditor.ManagedCategories do
|
||||
end)
|
||||
end
|
||||
|
||||
defp truthy?(value), do: value in [true, "true", "on", "1", 1]
|
||||
defp truthy?(value), do: BDS.Values.truthy?(value)
|
||||
|
||||
defp blank_to_nil(nil), do: nil
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ defmodule BDS.Desktop.ShellLive.SettingsEditor.ProjectSettings do
|
||||
}
|
||||
end
|
||||
|
||||
defp truthy?(value), do: value in [true, "true", "on", "1", 1]
|
||||
defp truthy?(value), do: BDS.Values.truthy?(value)
|
||||
|
||||
defp parse_integer(nil, fallback), do: fallback
|
||||
defp parse_integer(value, _fallback) when is_integer(value), do: value
|
||||
|
||||
Reference in New Issue
Block a user