josefrichter
Enum.into passing a non-empty list is deprecated
The docs say passing a non-empty list as the collectable is deprecated
https://hexdocs.pm/elixir/1.13.2/Enum.html#into/2
This is a common pattern in test fixtures:
Enum.into([a: 1, b: 2], %{b: 3})
which basically takes attrs and overwrites “defaults” in the map
The docs say consider using Keyword.merge(collectable, Enum.to_list(enumerable))
But how do I correctly merge list into a map like above? Because Keyword.merge/2 seems to merge only list into list, and Map.merge/2 only map into map. And I don’t think I should be converting list to a map before the merge.
Any hints, please?
Marked As Solved
LostKobrakai
Exactly.
Also Liked
eksperimental
the collectable is the second argument, not the first one. So you are good there.
eksperimental
If you are not getting a warning, and your Elixir version is updated, it is because you are not doing anything wrong.







