Skip to content

Commit

Permalink
Accept wrek_vert_t:t() in wrek_vert_t:from_defn/1
Browse files Browse the repository at this point in the history
This fixes a bug where callers generate instances of wrek_vert_t:t() and pass them to
wrek:start/2, and wrek complains that it cannot convert the definitions to records.
  • Loading branch information
rkallos committed Dec 31, 2018
1 parent 8b8abce commit ea1043b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/wrek_vert_t.erl
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ fail(Vert = #t{}, Reason) ->
set_status(Vert2, failed).


-spec from_defn(map()) -> {ok, t()} | {error, any()}.
-spec from_defn(map() | t()) -> {ok, t()} | {error, any()}.

from_defn(Map0) when is_map(Map0) ->
Res0 = #t{},
Expand All @@ -107,8 +107,11 @@ from_defn(Map0) when is_map(Map0) ->
{ok, Res3}
end;

from_defn(T = #t{}) ->
{ok, T};

from_defn(_) ->
{error, not_a_map}.
{error, not_map_or_record}.


-spec has_succeeded(t()) -> boolean().
Expand Down

0 comments on commit ea1043b

Please sign in to comment.