Skip to content

Commit 3b5f108

Browse files
HiniduJosé Valim
authored andcommitted
Add is_integer/1 guard for argument "n" in Stream.drop/2 (#7315)
1 parent e17b247 commit 3b5f108

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
@@ -318,11 +318,11 @@ defmodule Stream do
318318
319319
"""
320320
@spec drop(Enumerable.t(), non_neg_integer) :: Enumerable.t()
321-
def drop(enum, n) when n >= 0 do
321+
def drop(enum, n) when is_integer(n) and n >= 0 do
322322
lazy(enum, n, fn f1 -> R.drop(f1) end)
323323
end
324324

325-
def drop(enum, n) when n < 0 do
325+
def drop(enum, n) when is_integer(n) and n < 0 do
326326
n = abs(n)
327327

328328
lazy(enum, {0, [], []}, fn f1 ->

0 commit comments

Comments
 (0)