From 2fcfefb729e1ff3fa06a4cb9d531846c2056bcf2 Mon Sep 17 00:00:00 2001 From: Kip Cole Date: Thu, 2 Nov 2023 12:54:02 +0800 Subject: [PATCH] Fix warnings on Elixir 1.16 --- CHANGELOG.md | 10 ++++++++++ lib/cldr/utils/digits.ex | 2 +- mix.exs | 2 +- test/http_test.exs | 2 +- test/math/math_rounding_test.exs | 2 +- 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e43d1a..11277dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +**Cldr Utils from version 2.18.0 requires Elixir 1.11 or later** + +## Cldr Utils version 2.24.2 + +This is the changelog for Cldr Utils v2.24.2 released on November 2nd, 2023. For older changelogs please consult the release tag on [GitHub](https://github.com/elixir-cldr/cldr_utils/tags) + +### Bug Fixes + +* Fix depracation warnings for Elixir 1.16. + ## Cldr Utils version 2.24.1 This is the changelog for Cldr Utils v2.24.1 released on June 17th, 2023. For older changelogs please consult the release tag on [GitHub](https://github.com/elixir-cldr/cldr_utils/tags) diff --git a/lib/cldr/utils/digits.ex b/lib/cldr/utils/digits.ex index 6c2c3c4..7e01872 100644 --- a/lib/cldr/utils/digits.ex +++ b/lib/cldr/utils/digits.ex @@ -354,7 +354,7 @@ defmodule Cldr.Digits do A "compact" representation is returned, so there may be fewer digits returned than the decimal point location. """ - def to_digits(0.0), do: {[0], 1, 1} + def to_digits(float_0) when float_0 == 0.0, do: {[0], 1, 1} def to_digits(0), do: {[0], 1, 1} def to_digits(float) when is_float(float) do diff --git a/mix.exs b/mix.exs index 5271c1b..8f61bc7 100644 --- a/mix.exs +++ b/mix.exs @@ -1,7 +1,7 @@ defmodule Cldr.Utils.MixProject do use Mix.Project - @version "2.24.1" + @version "2.24.2" @source_url "https://github.com/elixir-cldr/cldr_utils" def project do diff --git a/test/http_test.exs b/test/http_test.exs index b7cd88f..921e39c 100644 --- a/test/http_test.exs +++ b/test/http_test.exs @@ -28,7 +28,7 @@ defmodule Cldr.Http.Test do assert {:ok, _headers, _body} = Cldr.Http.get_with_headers({"https://google.com", [{'Accept-Language', '*'}]}) end - if Version.compare(System.version, "1.14.9") == :gt do + if Version.compare(System.version(), "1.14.9") == :gt do test "Request with connection timeout" do options = [connection_timeout: 2] diff --git a/test/math/math_rounding_test.exs b/test/math/math_rounding_test.exs index 4e050ca..eef252a 100644 --- a/test/math/math_rounding_test.exs +++ b/test/math/math_rounding_test.exs @@ -17,7 +17,7 @@ defmodule Cldr.Math.RoundingTest do assert Cldr.Math.round(1.235e-4, 3, :half_even) == 0.0 end - for mode <- Cldr.Math.rounding_modes do + for mode <- Cldr.Math.rounding_modes() do number = 100_000.00 test "rounding 100_000.00 with mode #{inspect mode}" do assert unquote(number) == Cldr.Math.round(unquote(number), 2, unquote(mode))