Skip to content

Commit 66a202f

Browse files
author
José Valim
committed
Formatting
1 parent ae0a6c6 commit 66a202f

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

lib/gen_stage.ex

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1606,9 +1606,10 @@ defmodule GenStage do
16061606
@spec from_enumerable(Enumerable.t(), keyword) :: GenServer.on_start()
16071607
def from_enumerable(stream, opts \\ []) do
16081608
{:current_stacktrace, [_info_call | stack]} = Process.info(self(), :current_stacktrace)
1609+
16091610
case Keyword.pop(opts, :link, true) do
1610-
{true, opts} -> start_link(GenStage.Streamer, {{stream, opts}, stack}, opts)
1611-
{false, opts} -> start(GenStage.Streamer, {{stream, opts}, stack}, opts)
1611+
{true, opts} -> start_link(GenStage.Streamer, {stream, stack, opts}, opts)
1612+
{false, opts} -> start(GenStage.Streamer, {stream, stack, opts}, opts)
16121613
end
16131614
end
16141615

lib/gen_stage/streamer.ex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ defmodule GenStage.Streamer do
22
@moduledoc false
33
use GenStage
44

5-
def start_link({_, opts} = pair) do
5+
def start_link({stream, opts}) do
66
{:current_stacktrace, [_info_call | stack]} = Process.info(self(), :current_stacktrace)
7-
GenStage.start_link(__MODULE__, {pair, stack}, opts)
7+
GenStage.start_link(__MODULE__, {stream, stack, opts}, opts)
88
end
99

10-
def init({{stream, opts}, stack}) do
10+
def init({stream, stack, opts}) do
1111
continuation =
1212
&Enumerable.reduce(stream, &1, fn
1313
x, {acc, 1} -> {:suspend, {[x | acc], 0}}

0 commit comments

Comments
 (0)