Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Javier Garea <[email protected]>
  • Loading branch information
LoisSotoLopez and javiergarea authored Feb 8, 2024
1 parent 8390469 commit 730b869
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/ndto_generator.erl
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ is_valid(Prefix, #{one_of := Subschemas} = Schema) when is_list(Subschemas) ->
none,
[
erl_syntax:case_expr(
hd(chain_conditions(FunName, ValidationConditions, 'xor')),
erlang:hd(chain_conditions(FunName, ValidationConditions, 'xor')),
[
erl_syntax:clause(
[erl_syntax:atom('true')],
Expand Down Expand Up @@ -583,7 +583,7 @@ is_valid(Prefix, #{any_of := Subschemas} = Schema) when is_list(Subschemas) ->
none,
[
erl_syntax:case_expr(
hd(chain_conditions(FunName, ValidationConditions, 'orelse', true)),
erlang:hd(chain_conditions(FunName, ValidationConditions, 'orelse', true)),
[
erl_syntax:clause(
[erl_syntax:atom('true')],
Expand Down Expand Up @@ -661,7 +661,7 @@ is_valid(Prefix, #{all_of := Subschemas} = Schema) when is_list(Subschemas) ->
none,
[
erl_syntax:case_expr(
hd(chain_conditions(FunName, ValidationConditions, 'andalso', true)),
erlang:hd(chain_conditions(FunName, ValidationConditions, 'andalso', true)),
[
erl_syntax:clause(
[erl_syntax:atom('true')],
Expand Down Expand Up @@ -2615,7 +2615,7 @@ chain_conditions(FunName, ValidationConditions, Operator) ->
chain_conditions(FunName, ValidationConditions, 'andalso', false) ->
[
erl_syntax:case_expr(
hd(chain_conditions(FunName, ValidationConditions, 'andalso', true)),
erlang:hd(chain_conditions(FunName, ValidationConditions, 'andalso', true)),
[
erl_syntax:clause(
[erl_syntax:atom('true')],
Expand Down
2 changes: 1 addition & 1 deletion test/ndto_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ nullable(_Conf) ->
DTO2 = ndto:generate(test_nullable2, Schema2),
ok = ndto:load(DTO2),

<<Char:1/binary, _Rest/binary>> = TypeBin = atom_to_binary(Type),
<<Char:1/binary, _Rest/binary>> = TypeBin = erlang:atom_to_binary(Type),
Article =
case Char of
Vocal when Vocal =:= <<"a">>; Vocal =:= <<"o">>; Vocal =:= <<"i">> ->
Expand Down

0 comments on commit 730b869

Please sign in to comment.