diff --git a/lib/cldr/backend.ex b/lib/cldr/backend.ex index 7a4bca0..804b8c4 100644 --- a/lib/cldr/backend.ex +++ b/lib/cldr/backend.ex @@ -610,9 +610,9 @@ defmodule Cldr.Currency.Backend do """ @doc since: "2.15.0" - @spec current_territory_currencies() :: %{Cldr.Locale.territory_code() => Cldr.Currency.t()} + @spec current_territory_currencies() :: %{Cldr.Locale.territory_code() => Cldr.Currency.code()} def current_territory_currencies do - Cldr.Currency.current_territory_currencies(unquote(backend)) + Cldr.Currency.current_territory_currencies() end @doc """ diff --git a/lib/cldr/currency.ex b/lib/cldr/currency.ex index 78a49d4..ea9bc96 100644 --- a/lib/cldr/currency.ex +++ b/lib/cldr/currency.ex @@ -765,20 +765,15 @@ defmodule Cldr.Currency do Antartica, territory code `:AQ`) then no mapping is returned for that territory. - ## Arguments - - * `backend` is any module that includes `use Cldr` and therefore - is a `Cldr` backend module. The default is `Cldr.default_backend!/0` - ## Returns - * A map of `{territory_code => Cldr.Currency.t}` + * A map of `{territory_code => currency.code}` """ @doc since: "2.15.0" - @spec current_territory_currencies() :: %{Cldr.Locale.territory_code() => t()} - def current_territory_currencies(backend \\ Cldr.default_backend!()) do + @spec current_territory_currencies() :: %{Cldr.Locale.territory_code() => code()} + def current_territory_currencies do territory_currencies() |> Enum.map(fn {:ZZ, _currencies} -> @@ -787,7 +782,7 @@ defmodule Cldr.Currency do {territory, _currencies} -> case current_currency_for_territory(territory) do nil -> {territory, nil} - currency -> {territory, currency_for_code!(currency, backend)} + currency -> {territory, currency} end end) |> Enum.reject(fn @@ -1703,8 +1698,7 @@ defmodule Cldr.Currency do defimpl Cldr.DisplayName do def display_name(currency, options) do - {:ok, display_name} = Cldr.Currency.display_name(currency, options) - display_name + Cldr.Currency.display_name!(currency, options) end end end