From aeea8c2245b353bb23e35a71e3e98bbabb0a8535 Mon Sep 17 00:00:00 2001 From: Marcel Otto Date: Sun, 10 Apr 2022 23:09:44 +0200 Subject: [PATCH] Fix code style --- lib/rdf/prefix_map.ex | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/rdf/prefix_map.ex b/lib/rdf/prefix_map.ex index b646a60..1080270 100644 --- a/lib/rdf/prefix_map.ex +++ b/lib/rdf/prefix_map.ex @@ -130,9 +130,8 @@ defmodule RDF.PrefixMap do def merge(prefix_map1, prefix_map2) def merge(%__MODULE__{map: map1}, %__MODULE__{map: map2}) do - with [] <- merge_conflicts(map1, map2) do - {:ok, %__MODULE__{map: Map.merge(map1, map2)}} - else + case merge_conflicts(map1, map2) do + [] -> {:ok, %__MODULE__{map: Map.merge(map1, map2)}} conflicts -> {:error, conflicts} end end @@ -193,10 +192,10 @@ defmodule RDF.PrefixMap do end end - with resolved_merge = Map.merge(map1, map2, conflict_resolution), - [] <- resolved_merge_rest_conflicts(resolved_merge) do - {:ok, %__MODULE__{map: resolved_merge}} - else + resolved_merge = Map.merge(map1, map2, conflict_resolution) + + case resolved_merge_rest_conflicts(resolved_merge) do + [] -> {:ok, %__MODULE__{map: resolved_merge}} conflicts -> {:error, conflicts} end end