From ec41e0fe1ed95e46dbcbb7b7da83443de9b63725 Mon Sep 17 00:00:00 2001 From: Diogo Vinicius Kersting Date: Mon, 23 Dec 2013 11:55:02 -0200 Subject: [PATCH] fix bug in code sample for Stream.resource --- lib/elixir/lib/stream.ex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/elixir/lib/stream.ex b/lib/elixir/lib/stream.ex index afe8ac198a4..2e2f321d11a 100644 --- a/lib/elixir/lib/stream.ex +++ b/lib/elixir/lib/stream.ex @@ -892,14 +892,14 @@ defmodule Stream do ## Examples - Stream.resource(fn -> File.open("sample") end, + Stream.resource(fn -> File.open!("sample") end, fn file -> case IO.read(file, :line) do data when is_binary(data) -> { data, file } _ -> nil end end, - fn file -> File.close!(file) end) + fn file -> File.close(file) end) """ @spec resource((() -> acc), (acc -> { element, acc } | nil), (acc -> term)) :: Enumerable.t