Skip to content

Commit 8809ab2

Browse files
author
José Valim
committed
Do not leak Stream representation
1 parent 71e441d commit 8809ab2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lib/elixir/lib/stream.ex

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,3 +1088,12 @@ defimpl Enumerable, for: Stream do
10881088
end
10891089
end
10901090
end
1091+
1092+
defimpl Inspect, for: Stream do
1093+
import Inspect.Algebra
1094+
1095+
def inspect(%{enum: enum, funs: funs}, opts) do
1096+
inner = [enum: enum, funs: Enum.reverse(funs)]
1097+
concat ["#Stream<", to_doc(inner, opts), ">"]
1098+
end
1099+
end

0 commit comments

Comments
 (0)