Definitions with multiple clauses and default values require a function head

How to remove the warning is written very clear and with wonderfull examples in the warning itself.

In your particular case, it should look like this:

defp filter_content_type(list, acc \\ %{})
defp filter_content_type([h|t], acc) when is_map(acc) do
  # Stuff
end

defp filter_content_type([], acc) when is_map(acc) do
  acc
end
2 Likes