Skip to content

Commit

Permalink
fix charlist warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Schultzer committed Apr 27, 2024
1 parent 408d66b commit c28994f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* Fixed typespec in `info/1` and `info!/1`, thanks to @jfpedroza.
* Fixed typespec in `known_territory_subdivision/0`, thanks to @richard-ash.
* Fixed compiler warnings for Elixir 1.16, thanks to @tomciopp.
* Fixed compiler warnings for Elixir 1.17.
* Require Elixir 1.12.0.

## Cldr Territories v2.8.1 July 18, 2023
Expand Down
4 changes: 2 additions & 2 deletions lib/cldr/backend.ex
Original file line number Diff line number Diff line change
Expand Up @@ -937,7 +937,7 @@ defmodule Cldr.Territory.Backend do
:USD
iex> #{inspect __MODULE__}.to_currency_code!(:US, as: :charlist)
'USD'
~c"USD"
iex> #{inspect __MODULE__}.to_currency_code!("PS")
:ILS
Expand Down Expand Up @@ -987,7 +987,7 @@ defmodule Cldr.Territory.Backend do
[:USD]
iex> #{inspect __MODULE__}.to_currency_codes!(:US, as: :charlist)
['USD']
[~c"USD"]
iex> #{inspect __MODULE__}.to_currency_codes!("PS")
[:ILS, :JOD]
Expand Down
8 changes: 4 additions & 4 deletions lib/cldr/territory.ex
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,7 @@ defmodule Cldr.Territory do
def to_unicode_flag(territory_code) do
with {:ok, code} <- Cldr.validate_territory(territory_code),
true <- flag_exists?(code) do
{:ok, Enum.map_join('#{territory_code}', "", &to_unicode_font/1)}
{:ok, Enum.map_join(~c"#{territory_code}", "", &to_unicode_font/1)}
else
false -> {:error, {Cldr.UnknownFlagError, "The territory #{inspect territory_code} has no flag"}}
error -> error
Expand Down Expand Up @@ -836,7 +836,7 @@ defmodule Cldr.Territory do
:USD
iex> Cldr.Territory.to_currency_code!(:US, as: :charlist)
'USD'
~c"USD"
iex> Cldr.Territory.to_currency_code!("PS")
:ILS
Expand Down Expand Up @@ -901,7 +901,7 @@ defmodule Cldr.Territory do
[:USD]
iex> Cldr.Territory.to_currency_codes!(:US, as: :charlist)
['USD']
[~c"USD"]
iex> Cldr.Territory.to_currency_codes!("PS")
[:ILS, :JOD]
Expand Down Expand Up @@ -961,6 +961,6 @@ defmodule Cldr.Territory do

defp as(value, [as: :atom]), do: :"#{value}"
defp as(value, [as: :binary]), do: "#{value}"
defp as(value, [as: :charlist]), do: '#{value}'
defp as(value, [as: :charlist]), do: ~c"#{value}"
defp as(value, _options), do: as(value, [as: :atom])
end

0 comments on commit c28994f

Please sign in to comment.