From 8887dbab1efa518f9fff7bbe9de3d0b121bb6cd0 Mon Sep 17 00:00:00 2001 From: Colin Sheaff Date: Thu, 9 Jan 2020 22:08:39 -0600 Subject: [PATCH] Use Collectable protocol with an empty map --- lib/koans/20_comprehensions.ex | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/koans/20_comprehensions.ex b/lib/koans/20_comprehensions.ex index ff12018..e615596 100644 --- a/lib/koans/20_comprehensions.ex +++ b/lib/koans/20_comprehensions.ex @@ -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