henrik / progress_bar

Command-line progress bars and spinners for Elixir.
MIT License
329 stars 20 forks source link

Fix two compilation warnings in Elixir 1.11 #24

Closed michaelvigor closed 3 years ago

michaelvigor commented 3 years ago

Hello,

I was taking a look at the code and ran into a couple of compilation warnings with Elixir 1.11 which I thought I'd try to fix.

First, there are some warnings about Decimal being used but not being specified in the deps (which clearly isn't true)

warning: Decimal.round/3 defined in application :decimal is used by the current application but the current application does not directly depend on :decimal. To fix this, you must do one of:

  1. If :decimal is part of Erlang/Elixir, you must include it under :extra_applications inside "def application" in your mix.exs

  2. If :decimal is a dependency, make sure it is listed under "def deps" in your mix.exs

  3. In case you don't want to add a requirement to :decimal, you may optionally skip this warning by adding [xref: [exclude: Decimal] to your "def project" in mix.exs

  lib/progress_bar/bytes.ex:29: ProgressBar.Bytes.to_s/1

warning: Decimal.to_string/1 defined in application :decimal is used by the current application but the current application does not directly depend on :decimal. To fix this, you must do one of:

  1. If :decimal is part of Erlang/Elixir, you must include it under :extra_applications inside "def application" in your mix.exs

  2. If :decimal is a dependency, make sure it is listed under "def deps" in your mix.exs

  3. In case you don't want to add a requirement to :decimal, you may optionally skip this warning by adding [xref: [exclude: Decimal] to your "def project" in mix.exs

  lib/progress_bar/bytes.ex:29: ProgressBar.Bytes.to_s/1

Removing the :applications config means it should infer the application list from the deps.

Second, there is a deprecation warning about Decimal using Integer.to_char_list/1, upgrading to v2.0 fixes this warning.

henrik commented 3 years ago

Thank you so much! This is brilliant. :)

henrik commented 3 years ago

Published as version 2.0.1. Thank you again!