Skip to content
Permalink
Browse files

convert cond to case

  • Loading branch information
Maples7 committed Jun 14, 2019
1 parent 5ba5ace commit 913be4225298d9ef90f34727108d737ea5d7701c
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/field_mask.ex
@@ -57,11 +57,11 @@ defmodule FieldMask do
def reveal(tree, data) when is_map(tree) do
keys = Map.keys(tree)

cond do
keys === [] ->
case keys do
[] ->
data

keys === ["*"] ->
["*"] ->
cond do
is_list(data) ->
Enum.map(data, &reveal(tree["*"], &1))
@@ -76,7 +76,7 @@ defmodule FieldMask do
raise ArgumentError, message: "Wrong type for data: #{inspect(data)}"
end

true ->
_ ->
cond do
is_list(data) ->
Enum.map(data, &reveal(tree, &1))

0 comments on commit 913be42

Please sign in to comment.
You can’t perform that action at this time.