File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -243,7 +243,7 @@ defmodule Bankster.Iban do
243243 def bban ( iban ) do
244244 iban
245245 |> format_default ( )
246- |> String . slice ( 4 .. - 1 )
246+ |> String . slice ( 4 .. - 1 // 1 )
247247 end
248248
249249 @ doc """
@@ -333,7 +333,7 @@ defmodule Bankster.Iban do
333333 @ spec iban_violates_country_rule? ( String . t ( ) ) :: boolean
334334 defp iban_violates_country_rule? ( iban ) do
335335 if iban_rule = get_in ( @ iban_rules , [ country_code ( iban ) , :rule ] ) do
336- ! Regex . match? ( iban_rule , String . slice ( format_default ( iban ) , 4 .. - 1 ) )
336+ ! Regex . match? ( iban_rule , String . slice ( format_default ( iban ) , 4 .. - 1 // 1 ) )
337337 else
338338 false
339339 end
@@ -342,7 +342,10 @@ defmodule Bankster.Iban do
342342 @ spec iban_violates_checksum? ( String . t ( ) ) :: boolean
343343 defp iban_violates_checksum? ( iban ) do
344344 remainder =
345- for ( << c <- bban ( iban ) <> country_code ( iban ) <> "00" >> , into: "" , do: @ replacements [ << c >> ] || << c >> )
345+ for ( << c <- bban ( iban ) <> country_code ( iban ) <> "00" >> ,
346+ into: "" ,
347+ do: @ replacements [ << c >> ] || << c >>
348+ )
346349 |> String . to_integer ( )
347350 |> rem ( 97 )
348351
Original file line number Diff line number Diff line change @@ -411,15 +411,15 @@ defmodule Bankster.Iban.IbanTest do
411411 for iban <- @ unformated_ibans do
412412 assert (
413413 Bankster.Iban . bban ( iban ) ==
414- String . replace ( iban , ~r/ \s */ , "" ) |> String . upcase ( ) |> String . slice ( 4 .. - 1 )
414+ String . replace ( iban , ~r/ \s */ , "" ) |> String . upcase ( ) |> String . slice ( 4 .. - 1 // 1 )
415415 )
416416 end
417417
418418 # Formated IBANs
419419 for iban <- @ formated_ibans do
420420 assert (
421421 Bankster.Iban . bban ( iban ) ==
422- String . replace ( iban , ~r/ \s */ , "" ) |> String . upcase ( ) |> String . slice ( 4 .. - 1 )
422+ String . replace ( iban , ~r/ \s */ , "" ) |> String . upcase ( ) |> String . slice ( 4 .. - 1 // 1 )
423423 )
424424 end
425425 end
You can’t perform that action at this time.
0 commit comments