Merge pull request #248 from selfsimilar/forinto

Use Collectable protocol with an empty map
This commit is contained in:
Uku Taht
2020-01-10 14:03:28 +02:00
committed by GitHub

View File

@@ -25,8 +25,7 @@ defmodule Comprehensions do
end
koan "Add the result of a comprehension to an existing collection" do
collection = ["Apple Pie"]
collection = for x <- ["Pecan", "Pumpkin"], into: collection, do: "#{x} Pie"
collection = for x <- ["Pecan", "Pumpkin"], into: %{}, do: {x, "#{x} Pie"}
assert collection == ___
end