Skip to content

Commit

Permalink
Resolve warning in Elixir 1.18 (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
aj-foster authored Dec 21, 2024
1 parent a4507a1 commit 3e902ad
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 12 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,5 @@ jobs:
otp: 26
- elixir: 1.17
otp: 27

- elixir: 1.18
otp: 27
4 changes: 2 additions & 2 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
elixir 1.16
erlang 26.0
elixir 1.18
erlang 27.2
10 changes: 1 addition & 9 deletions lib/ua_parser/processor.ex
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ defmodule UAParser.Processor do
# result: {user_agents, os, devices}
groups
|> Enum.map(&compile_groups/1)
|> to_tuple
|> :erlang.list_to_tuple()
end

defp compile_group(group) do
Expand Down Expand Up @@ -58,12 +58,4 @@ defmodule UAParser.Processor do
keyword = {atom_key(key), String.Chars.to_string(value)}
[keyword | to_keyword(tails)]
end

defp to_tuple(values, tuple \\ {})
defp to_tuple([], tuple), do: tuple

defp to_tuple([head | tail], tuple) do
tuple = Tuple.append(tuple, head)
to_tuple(tail, tuple)
end
end

0 comments on commit 3e902ad

Please sign in to comment.