Merge pull request #1 from vkatsuba/fix/warning_failed_to_boot_redis
Fix warnings
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -16,3 +16,4 @@ _build
|
||||
.idea
|
||||
rebar3.crashdump
|
||||
**~
|
||||
rebar3
|
||||
|
||||
@@ -1,7 +1,2 @@
|
||||
{erl_opts, [debug_info]}.
|
||||
{deps, []}.
|
||||
|
||||
{shell, [
|
||||
% {config, "config/sys.config"},
|
||||
{apps, [redis]}
|
||||
]}.
|
||||
|
||||
9
src/redis.app.src
Normal file
9
src/redis.app.src
Normal file
@@ -0,0 +1,9 @@
|
||||
{application, redis,
|
||||
[{description, "redis is an application and library implementing redis protocol in Erlang"},
|
||||
{vsn, semver},
|
||||
{registered, []},
|
||||
{env, []},
|
||||
{applications, [kernel, stdlib]},
|
||||
{licenses, ["ISC License"]},
|
||||
{links, [{"Github", "https://github.com/niamtokik/redis.git"}]}]
|
||||
}.
|
||||
@@ -6,10 +6,10 @@
|
||||
-export([encode/1, decode/1]).
|
||||
-include_lib("eunit/include/eunit.hrl").
|
||||
|
||||
-type encode_error() :: {error, bitstring() | binary()}.
|
||||
%-type encode_error() :: {error, bitstring() | binary()}.
|
||||
-type encode_integer() :: integer().
|
||||
-type encode_string() :: bitstring() | binary().
|
||||
-type encode_bulk_string() :: {bulk_string, bitstring()}.
|
||||
-type encode_bulk_string() :: {bulk_string, bitstring() | null} | list() | {error, binary()}.
|
||||
-type encode_array() :: [encode_integer() |
|
||||
encode_string() |
|
||||
encode_bulk_string()].
|
||||
@@ -128,7 +128,7 @@ encode_valid_char(Bitstring)
|
||||
List :: list(),
|
||||
Buffer :: bitstring() | binary(),
|
||||
Counter :: integer(),
|
||||
Return :: bitstring() | binary().
|
||||
Return :: {ok, bitstring() | binary(), integer()}.
|
||||
encode_array([], Buffer, Counter) ->
|
||||
{ok, Buffer, Counter};
|
||||
encode_array([H|T], Buffer, Counter) ->
|
||||
@@ -211,12 +211,12 @@ decode_integer(<<Char, Rest/bitstring>>, Buffer)
|
||||
%%--------------------------------------------------------------------
|
||||
%%
|
||||
%%--------------------------------------------------------------------
|
||||
decode_separator(Bitstring) ->
|
||||
case binary:split(Bitstring, <<"\r\n">>) of
|
||||
[<<>>] -> {ok, <<>>};
|
||||
[<<>>,<<>>] -> {ok, <<>>};
|
||||
[Value,Rest] -> {ok, Value, Rest}
|
||||
end.
|
||||
%decode_separator(Bitstring) ->
|
||||
% case binary:split(Bitstring, <<"\r\n">>) of
|
||||
% [<<>>] -> {ok, <<>>};
|
||||
% [<<>>,<<>>] -> {ok, <<>>};
|
||||
% [Value,Rest] -> {ok, Value, Rest}
|
||||
% end.
|
||||
|
||||
%%--------------------------------------------------------------------
|
||||
%%
|
||||
@@ -265,9 +265,9 @@ decode_error(Bitstring) ->
|
||||
|
||||
decode_error(<<"\r\n">>, Buffer) ->
|
||||
{ok, {error, Buffer}};
|
||||
decode_error(<<"\r", Rest/bitstring>>, _) ->
|
||||
decode_error(<<"\r", _/bitstring>>, _) ->
|
||||
{error, badchar};
|
||||
decode_error(<<"\n", Rest/bitstring>>, _) ->
|
||||
decode_error(<<"\n", _/bitstring>>, _) ->
|
||||
{error, badchar};
|
||||
decode_error(<<Char, Rest/bitstring>>, Buffer) ->
|
||||
decode_error(Rest, <<Buffer/bitstring, Char>>).
|
||||
|
||||
Reference in New Issue
Block a user