Skip to content

Commit b1e2edc

Browse files
Fix test after Elixir 1.15 deprecated
1 parent 2d6994d commit b1e2edc

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

test/elixir_analyzer/test_suite/gotta_snatch_em_all_test.exs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -68,25 +68,13 @@ defmodule ElixirAnalyzer.ExerciseTest.GottSnatchEmAllTest do
6868

6969
@spec split_shiny_cards(collection()) :: {[card()], [card()]}
7070
def split_shiny_cards(collection) do
71-
{shiny, not_shiny} = split_with(collection, &String.starts_with?(&1, "Shiny"))
71+
{shiny, not_shiny} = MapSet.split_with(collection, &String.starts_with?(&1, "Shiny"))
7272

7373
shiny_list = shiny |> MapSet.to_list() |> Enum.sort()
7474
not_shiny_list = not_shiny |> MapSet.to_list() |> Enum.sort()
7575

7676
{shiny_list, not_shiny_list}
7777
end
78-
79-
defp split_with(mapset, predicate) do
80-
init = {MapSet.new(), MapSet.new()}
81-
82-
Enum.reduce(mapset, init, fn item, {passes, fails} ->
83-
if predicate.(item) do
84-
{MapSet.put(passes, item), fails}
85-
else
86-
{passes, MapSet.put(fails, item)}
87-
end
88-
end)
89-
end
9078
end
9179
end
9280

0 commit comments

Comments
 (0)