From 9610b26241409e272d7d8b00f2c8eeed6a35f929 Mon Sep 17 00:00:00 2001 From: Jechol Lee Date: Tue, 8 Sep 2020 18:04:44 +0900 Subject: [PATCH] Fixed interal consistency error on elixir 1.10.4 --- README.md | 2 +- lib/base32h.ex | 6 +++--- mix.exs | 4 ++-- shell.nix | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 27f2848..fa156e0 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ The package can be installed by adding `base32h` to your list of dependencies in ```elixir def deps do [ - {:base32h, "~> 0.3.0"} + {:base32h, "~> 0.3.1"} ] end ``` diff --git a/lib/base32h.ex b/lib/base32h.ex index 5481247..031aeb3 100644 --- a/lib/base32h.ex +++ b/lib/base32h.ex @@ -74,7 +74,7 @@ defmodule Base32H do "WELLH0WDYPARDNER" """ @spec encode_bin(binary()) :: String.t() - def encode_bin(<> = bin) do + def encode_bin(bin) when is_binary(bin) do padded = add_padding(bin, 5, 0) for <> do @@ -93,7 +93,7 @@ defmodule Base32H do 8_675_309 """ @spec decode(String.t()) :: non_neg_integer() - def decode(<> = str) do + def decode(str) when is_binary(str) do str |> String.to_charlist() |> Enum.reduce(0, fn c, acc -> acc * 32 + Map.fetch!(@decode_map, c) end) @@ -106,7 +106,7 @@ defmodule Base32H do <<0, 0, 0, 8, 6, 7, 5, 3, 0, 9>> """ @spec decode_bin(String.t()) :: binary() - def decode_bin(<> = str) do + def decode_bin(str) when is_binary(str) do binary_size = (div(String.length(str) - 1, 8) + 1) * 5 <> end diff --git a/mix.exs b/mix.exs index 34cdf20..77c47ec 100644 --- a/mix.exs +++ b/mix.exs @@ -4,7 +4,7 @@ defmodule Base32H.MixProject do def project do [ app: :base32h, - version: "0.3.0", + version: "0.3.1", elixir: "~> 1.8", start_permanent: Mix.env() == :prod, deps: deps(), @@ -26,7 +26,7 @@ defmodule Base32H.MixProject do defp deps do [ {:ex_doc, "~> 0.22", only: :dev, runtime: false} - # {:dep_from_hexpm, "~> 0.3.0"}, + # {:dep_from_hexpm, "~> 0.3.1"}, # {:dep_from_git, git: "https://github.com/elixir-lang/my_dep.git", tag: "0.1.0"} ] end diff --git a/shell.nix b/shell.nix index 374eb6f..5f627b2 100644 --- a/shell.nix +++ b/shell.nix @@ -5,5 +5,5 @@ let inherit (pkgs.lib) optional optionals; in pkgs.mkShell { buildInputs = - [ jechol-nur.beam.all.packages.erlang_22_0.elixirs.elixir_1_10_0 ]; + [ jechol-nur.beam.all.packages.erlang_23_0.elixirs.elixir_1_10_4 ]; }