Skip to content

Commit 0bc0419

Browse files
mgartnerJosé Valim
authored andcommitted
Clarify Enum.group_by/3 deprecation message (#4852)
Signed-off-by: José Valim <jose.valim@plataformatec.com.br>
1 parent d195b75 commit 0bc0419

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/elixir/lib/enum.ex

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -997,7 +997,8 @@ defmodule Enum do
997997

998998
# TODO: Remove on 2.0
999999
def group_by(enumerable, dict, fun) when is_function(fun, 1) do
1000-
IO.warn "Enum.group_by/3 with a map/dictionary as second element is deprecated, please use a map instead"
1000+
IO.warn "Enum.group_by/3 with a map/dictionary as second element is deprecated. " <>
1001+
"A map is used by default and it is no longer required to pass one to this function"
10011002
reduce(reverse(enumerable), dict, fn(entry, categories) ->
10021003
Dict.update(categories, fun.(entry), [entry], &[entry | &1])
10031004
end)

0 commit comments

Comments
 (0)