Skip to content

Commit

Permalink
[credo] use Enum.empty?
Browse files Browse the repository at this point in the history
  • Loading branch information
solnic committed Oct 31, 2023
1 parent 13a8530 commit 6992f9b
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/drops/validator.ex
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,7 @@ defmodule Drops.Validator do

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

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

error ->
error
Expand Down

0 comments on commit 6992f9b

Please sign in to comment.