Skip to content

Commit 9252a16

Browse files
mgartnerjosevalim
authored andcommitted
Clarify Enum.group_by/3 deprecation message (#4852)
1 parent 5c91a73 commit 9252a16

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
@@ -999,7 +999,8 @@ defmodule Enum do
999999

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

0 commit comments

Comments
 (0)