Skip to content

Commit 3b96b74

Browse files
authored
Add specs to Kernel.binary_slice (#15667)
1 parent 70624ef commit 3b96b74

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

lib/elixir/lib/kernel.ex

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4960,6 +4960,7 @@ defmodule Kernel do
49604960
49614961
"""
49624962
@doc since: "1.14.0"
4963+
@spec binary_slice(binary, integer, non_neg_integer) :: binary
49634964
def binary_slice(binary, start, size)
49644965
when is_binary(binary) and is_integer(start) and is_integer(size) and size >= 0 do
49654966
total = byte_size(binary)
@@ -5033,6 +5034,7 @@ defmodule Kernel do
50335034
50345035
"""
50355036
@doc since: "1.14.0"
5037+
@spec binary_slice(binary, Range.t()) :: binary
50365038
def binary_slice(binary, first..last//step)
50375039
when is_binary(binary) and step > 0 do
50385040
total = byte_size(binary)

0 commit comments

Comments
 (0)