Use iolists in collectable for binaries

This commit is contained in:
José Valim
2014-06-30 20:33:38 +02:00
parent 782314abff
commit da4d047a37
+2 -2
View File
@@ -85,8 +85,8 @@ defimpl Collectable, for: BitString do
def into(original) do
{original, fn
bitstring, {:cont, x} -> <<bitstring :: bits, x :: bits>>
bitstring, :done -> bitstring
acc, {:cont, x} when is_bitstring(x) -> [acc|x]
acc, :done -> IO.iodata_to_binary(acc)
_, :halt -> :ok
end}
end