From 82fff2417671a67b70e1ad328f438b2ad55797ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20=C3=81lvarez=20Belaustegui?= Date: Sun, 7 Jul 2024 12:58:24 +0200 Subject: [PATCH] Minor code improvements (#85) --- lib/trans/translator.ex | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/trans/translator.ex b/lib/trans/translator.ex index 86818ad..2f99278 100644 --- a/lib/trans/translator.ex +++ b/lib/trans/translator.ex @@ -182,7 +182,8 @@ defmodule Trans.Translator do end end - defp translate_fields(%{__struct__: module} = struct, locale, default_locale) when is_list(locale) do + defp translate_fields(%{__struct__: module} = struct, locale, default_locale) + when is_list(locale) do fields = module.__trans__(:fields) Enum.reduce(fields, struct, fn field, struct -> @@ -193,7 +194,7 @@ defmodule Trans.Translator do end) end - defp translate_fields(%{__struct__: module} = struct, locale, default_locale) do + defp translate_fields(%{__struct__: _module} = struct, locale, default_locale) do translate_fields(struct, [locale], default_locale) end