Skip to content

Commit

Permalink
Replace integer_to_binary for R15B compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
davidw committed Feb 18, 2015
1 parent 673d4b2 commit 138db7e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/epgsql_binary.erl
Expand Up @@ -152,7 +152,8 @@ encode_hstore_value(Val) -> encode_hstore_string(Val).
encode_hstore_string(Str) when is_list(Str) -> encode_hstore_string(list_to_binary(Str));
encode_hstore_string(Str) when is_atom(Str) -> encode_hstore_string(atom_to_binary(Str, utf8));
encode_hstore_string(Str) when is_integer(Str) ->
encode_hstore_string(erlang:integer_to_binary(Str));
%% FIXME - we can use integer_to_binary when we deprecate R15
encode_hstore_string(list_to_binary(integer_to_list(Str)));
encode_hstore_string(Str) when is_float(Str) ->
encode_hstore_string(iolist_to_binary(io_lib:format("~w", [Str])));
encode_hstore_string(Str) when is_binary(Str) -> <<(byte_size(Str)):?int32, Str/binary>>.
Expand Down

0 comments on commit 138db7e

Please sign in to comment.