Skip to content

Commit

Permalink
Fix compilation warnings turned into errors on Elixir 1.17
Browse files Browse the repository at this point in the history
  • Loading branch information
g-andrade committed Jun 14, 2024
1 parent 778eef6 commit 6818ef2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/sqids/alphabet.ex
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ defmodule Sqids.Alphabet do
def char_at!(alphabet, index), do: Map.fetch!(alphabet, index)

@spec split_and_exchange!(t(), index) :: t()
def split_and_exchange!(alphabet, split_index) when split_index in 0..(map_size(alphabet) - 1) do
def split_and_exchange!(alphabet, split_index) when split_index in 0..(map_size(alphabet) - 1)//1 do

Check failure on line 59 in lib/sqids/alphabet.ex

View workflow job for this annotation

GitHub Actions / Run CI with Elixir 1.7

** (SyntaxError) lib/sqids/alphabet.ex:59: syntax error before: '/'

Check failure on line 59 in lib/sqids/alphabet.ex

View workflow job for this annotation

GitHub Actions / Run CI with Elixir 1.8

** (SyntaxError) lib/sqids/alphabet.ex:59: syntax error before: '/'

Check failure on line 59 in lib/sqids/alphabet.ex

View workflow job for this annotation

GitHub Actions / Run CI with Elixir 1.9

** (SyntaxError) lib/sqids/alphabet.ex:59: syntax error before: '/'

Check failure on line 59 in lib/sqids/alphabet.ex

View workflow job for this annotation

GitHub Actions / Run CI with Elixir 1.10

** (SyntaxError) lib/sqids/alphabet.ex:59: syntax error before: '/'
alphabet_size = map_size(alphabet)

map(alphabet, fn {index, char} ->
Expand All @@ -82,7 +82,7 @@ defmodule Sqids.Alphabet do
end

@spec get_slice_chars!(t(), pos_integer) :: [byte, ...]
def get_slice_chars!(alphabet, size) when size in 1..map_size(alphabet) do
def get_slice_chars!(alphabet, size) when size in 1..map_size(alphabet)//1 do
Enum.reduce((size - 1)..0, _acc = [], fn index, acc -> [char_at!(alphabet, index) | acc] end)
end

Expand Down

0 comments on commit 6818ef2

Please sign in to comment.