2015-11-20 33 views

回答

1

使用Enum.into

[1, 2, 1] |> Enum.into(HashSet.new) #=> #HashSet<[1, 2]>