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?