mirror of
https://github.com/sloanelybutsurely/typeid-elixir.git
synced 2025-05-21 12:32:54 -04:00
use binary_part/3 for elixir 1.11 support
This commit is contained in:
parent
4261b1a00c
commit
f686c4650a
1 changed files with 2 additions and 2 deletions
|
@ -181,10 +181,10 @@ defmodule TypeID do
|
|||
|
||||
prefix =
|
||||
str
|
||||
|> binary_slice(0, size - 26)
|
||||
|> binary_part(0, size - 26)
|
||||
|> String.replace(~r/_$/, "")
|
||||
|
||||
suffix = binary_slice(str, size - 26, 26)
|
||||
suffix = binary_part(str, size - 26, 26)
|
||||
|
||||
if prefix == "" do
|
||||
raise ArgumentError, "A TypeID without a prefix should not have a leading underscore"
|
||||
|
|
Loading…
Reference in a new issue