Skip to content

Commit

Permalink
Address credo warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
solnic committed Oct 30, 2023
1 parent a6df1af commit 9f69aa8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/drops/validator.ex
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ defmodule Drops.Validator do

errors = Enum.reject(result, &is_ok/1)

if length(errors) == 0,
if Enum.empty?(errors),
do: {:ok, {path, result}},
else: {:error, errors}

Expand Down
2 changes: 1 addition & 1 deletion lib/drops/validator/messages/error.ex
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ defmodule Drops.Validator.Messages.Error do
defstruct [:text, path: []]

defimpl String.Chars, for: Error.Rule do
def to_string(%Error.Rule{text: text, path: path}) when length(path) == 0 do
def to_string(%Error.Rule{text: text, path: path}) when Enum.empty?(path) do

Check failure on line 108 in lib/drops/validator/messages/error.ex

View workflow job for this annotation

GitHub Actions / Build and test (1.14.5, 26.1)

** (CompileError) lib/drops/validator/messages/error.ex:108: cannot invoke remote function Enum.empty?/1 inside guards

Check failure on line 108 in lib/drops/validator/messages/error.ex

View workflow job for this annotation

GitHub Actions / Build and test (1.14.5, 25.3)

** (CompileError) lib/drops/validator/messages/error.ex:108: cannot invoke remote function Enum.empty?/1 inside guards
text
end

Expand Down

0 comments on commit 9f69aa8

Please sign in to comment.