Merge branch 'flake-from-int' into 'develop'

Flake: support integers in from_string/1

See merge request pleroma/pleroma!715
This commit is contained in:
kaniini 2019-01-26 16:17:50 +00:00
commit 155a884300
2 changed files with 5 additions and 0 deletions

View file

@ -33,6 +33,10 @@ defmodule Pleroma.FlakeId do
def to_string(s), do: s
def from_string(int) when is_integer(int) do
from_string(Kernel.to_string(int))
end
for i <- [-1, 0] do
def from_string(unquote(i)), do: <<0::integer-size(128)>>
def from_string(unquote(Kernel.to_string(i))), do: <<0::integer-size(128)>>