Skip to content

Commit e6c2d17

Browse files
committed
fix: failing checks
1 parent 9140687 commit e6c2d17

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

lib/algora/shared/color.ex

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,10 @@ defmodule Algora.Color do
1414
|> String.split(~r/[,\s]+/, trim: true)
1515
|> Enum.map(&String.trim/1)
1616
|> Enum.map(fn str ->
17-
str = String.replace(str, "%", "")
18-
19-
with {:error, _} <- Float.parse(str),
20-
{:error, _} <- Integer.parse(str) do
21-
raise "Invalid number: #{str}"
22-
else
23-
{num, _} -> num * 1.0
24-
end
17+
str
18+
|> String.replace("%", "")
19+
|> Float.parse()
20+
|> then(fn {num, _} -> num end)
2521
end)
2622
|> then(fn [h, s, l] -> hsl_to_hex(h, s, l) end)
2723
end

mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ defmodule Algora.MixProject do
7575
{:oban, "~> 2.17"},
7676
{:styler, "~> 1.2", only: [:dev, :test], runtime: false},
7777
{:typed_ecto_schema, "~> 0.4.1", runtime: false},
78-
{:chameleon, "~> 2.2.0", only: [:dev]}
78+
{:chameleon, "~> 2.2.0"}
7979
]
8080
end
8181

0 commit comments

Comments
 (0)