Get rid of a few dialyzer warnings

This commit is contained in:
Carlos Martín Nieto
2014-02-14 00:40:48 +01:00
parent 378c04284a
commit 1a79093274
3 changed files with 5 additions and 5 deletions

View File

@@ -18,7 +18,7 @@ hex(Oid) ->
geef_nif:oid_fmt(Oid). geef_nif:oid_fmt(Oid).
%% @doc Parse an iolist as a hash %% @doc Parse an iolist as a hash
-spec parse(iolist()) -> geef_oid:oid(). -spec parse(iolist() | binary()) -> geef_oid:oid().
parse(Sha) -> parse(Sha) ->
geef_nif:oid_parse(Sha). geef_nif:oid_parse(Sha).

View File

@@ -8,7 +8,7 @@
-type iterator() :: #geef_iterator{type :: ref}. -type iterator() :: #geef_iterator{type :: ref}.
-type type() :: oid | symbolic. -type type() :: oid | symbolic.
-type target() :: binary() | geef_oid:oid(). -type target() :: binary() | geef_oid:oid().
-type ref() :: #geef_reference{name :: binary()}. -type ref() :: #geef_reference{repo :: pid(), name :: binary()}.
-export_type([reference/0, type/0, target/0, iterator/0]). -export_type([reference/0, type/0, target/0, iterator/0]).
-spec create(pid(), iolist(), geef_oid:oid(), boolean()) -> {ok, ref()} | {error, term()}. -spec create(pid(), iolist(), geef_oid:oid(), boolean()) -> {ok, ref()} | {error, term()}.
@@ -106,10 +106,10 @@ shorthand(#geef_reference{name=Name}) ->
shorthand(Name). shorthand(Name).
%% @doc Return whether the reference has a reflog %% @doc Return whether the reference has a reflog
-spec has_log(pid(), iolist()) -> {ok, boolean()} | {error, term()}. -spec has_log(pid(), iolist() | binary()) -> {ok, boolean()} | {error, term()}.
has_log(Repo, Name) -> has_log(Repo, Name) ->
geef_repo:reference_has_log(Repo, Name). geef_repo:reference_has_log(Repo, Name).
-spec has_log(ref()) -> boolean() | {ok, boolean()} | {error | term()}. -spec has_log(ref()) -> {ok, boolean()} | {error, term()}.
has_log(#geef_reference{repo=Repo, name=Name}) -> has_log(#geef_reference{repo=Repo, name=Name}) ->
has_log(Repo, Name). has_log(Repo, Name).

View File

@@ -34,7 +34,7 @@ now(Name, Email) ->
%% @private %% @private
%% @doc convert the return from the NIF to a signature %% @doc convert the return from the NIF to a signature
-spec convert(binary(), binary(), non_neg_integer(), non_neg_integer()) -> signature(). -spec convert(iolist(), iolist(), non_neg_integer(), non_neg_integer()) -> signature().
convert(Name, Email, Timestamp, Offset) -> convert(Name, Email, Timestamp, Offset) ->
Time = {{Timestamp div 1000000, Timestamp rem 1000000, 0}, Offset}, Time = {{Timestamp div 1000000, Timestamp rem 1000000, 0}, Offset},
#geef_signature{name=Name, email=Email, time=Time}. #geef_signature{name=Name, email=Email, time=Time}.