Skip to content

Commit 1cbceef

Browse files
committed
Remove deprecated support for char lists
1 parent 885801f commit 1cbceef

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

lib/hashids.ex

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,6 @@ defmodule Hashids do
179179
defp parse_option!(:alphabet, kw) do
180180
list = case Keyword.fetch(kw, :alphabet) do
181181
:error -> @default_alphabet
182-
# Deprecated. Left for compatibility with 1.0.
183-
{:ok, list} when is_list(list) -> list
184182
{:ok, bin} when is_binary(bin) -> String.to_char_list(bin)
185183
_ ->
186184
message = "Alphabet has to be a string of at least 16 characters/codepoints."
@@ -194,8 +192,6 @@ defmodule Hashids do
194192
defp parse_option!(:salt, kw) do
195193
case Keyword.fetch(kw, :salt) do
196194
:error -> []
197-
# Deprecated. Left for compatibility with 1.0.
198-
{:ok, list} when is_list(list) -> list
199195
{:ok, bin} when is_binary(bin) -> String.to_char_list(bin)
200196
_ -> raise Hashids.Error, message: "Salt has to be a (possibly empty) string."
201197
end

test/test_helper.exs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,8 @@ defmodule HashidsTest.Helpers do
3838
end
3939

4040
defp build_opts(salt, min_len, alphabet) do
41-
salt = String.to_char_list(salt)
4241
len = String.to_integer(min_len)
43-
alphabet_opt = if alphabet == "", do: [], else: [alphabet: String.to_char_list(alphabet)]
42+
alphabet_opt = if alphabet == "", do: [], else: [alphabet: alphabet]
4443
alphabet_opt ++ [salt: salt, min_len: len]
4544
end
4645

0 commit comments

Comments
 (0)