Skip to content

Commit b3ba125

Browse files
author
José Valim
committed
Merge pull request #1956 from diogovk/master
fix bug in code sample for Stream.resource
2 parents 5b5075b + ec41e0f commit b3ba125

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/elixir/lib/stream.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -892,14 +892,14 @@ defmodule Stream do
892892
893893
## Examples
894894
895-
Stream.resource(fn -> File.open("sample") end,
895+
Stream.resource(fn -> File.open!("sample") end,
896896
fn file ->
897897
case IO.read(file, :line) do
898898
data when is_binary(data) -> { data, file }
899899
_ -> nil
900900
end
901901
end,
902-
fn file -> File.close!(file) end)
902+
fn file -> File.close(file) end)
903903
904904
"""
905905
@spec resource((() -> acc), (acc -> { element, acc } | nil), (acc -> term)) :: Enumerable.t

0 commit comments

Comments
 (0)