fix: elvis warning

This commit is contained in:
Zhongwen Deng 2022-05-23 15:37:18 +08:00
parent 96baf4ccdb
commit 239949ff0b
1 changed files with 8 additions and 7 deletions

View File

@ -338,19 +338,20 @@ raw_conf_with_default(SchemaMod, RootNames, RawConf) ->
false -> false ->
Acc; Acc;
{_, {_, Schema}} -> {_, {_, Schema}} ->
Default = Acc#{Name => schema_default(Schema)}
case hocon_schema:field_schema(Schema, type) of
?ARRAY(_) -> [];
?LAZY(?ARRAY(_)) -> [];
_ -> #{}
end,
Acc#{Name => Default}
end end
end end
end, end,
RawDefault = lists:foldl(Fun, #{}, RootNames), RawDefault = lists:foldl(Fun, #{}, RootNames),
maps:merge(RawConf, fill_defaults(SchemaMod, RawDefault, #{})). maps:merge(RawConf, fill_defaults(SchemaMod, RawDefault, #{})).
schema_default(Schema) ->
case hocon_schema:field_schema(Schema, type) of
?ARRAY(_) -> [];
?LAZY(?ARRAY(_)) -> [];
_ -> #{}
end.
parse_hocon(Conf) -> parse_hocon(Conf) ->
IncDirs = include_dirs(), IncDirs = include_dirs(),
case do_parse_hocon(Conf, IncDirs) of case do_parse_hocon(Conf, IncDirs) of