some fixes from dialyzer output
This commit is contained in:
committed by
Carlos Martín Nieto
parent
f943274ad8
commit
b2af788af0
@@ -8,8 +8,8 @@ defmodule Geef.Pkt do
|
||||
|
||||
def parse_request(str) do
|
||||
case :geef_pkt.parse_request(str) do
|
||||
{:ok, req} ->
|
||||
{:ok, Geef.Request.new req}
|
||||
{:ok, {:geef_request, service, path, host}} ->
|
||||
{:ok, %Geef.Request{service: service, path: path, host: host}}
|
||||
error ->
|
||||
error
|
||||
end
|
||||
|
||||
@@ -14,7 +14,7 @@ defmodule Geef.Signature do
|
||||
%Geef.Signature{name: name, email: email, time: time}
|
||||
end
|
||||
|
||||
def to_record(%Geef.Signature{name: name, email: email, time: time}) do
|
||||
def to_record(%Geef.Signature{name: name, email: email, time: time}) do
|
||||
{:geef_signature, name, email, time}
|
||||
end
|
||||
|
||||
|
||||
@@ -71,13 +71,13 @@ defimpl Enumerable, for: Geef.Tree do
|
||||
alias Geef.TreeError
|
||||
|
||||
def count(tree) do
|
||||
Tree.count(tree)
|
||||
{:ok, Tree.count(tree)}
|
||||
end
|
||||
|
||||
def member?(tree, key) do
|
||||
case Tree.get(tree, key) do
|
||||
{:ok, _} -> true
|
||||
_ -> false
|
||||
{:ok, _} -> {:ok, true}
|
||||
_ -> {:ok, false}
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
9
mix.exs
9
mix.exs
@@ -113,7 +113,8 @@ defmodule Geef.Mixfile do
|
||||
[ app: :geef,
|
||||
version: "0.0.1",
|
||||
compilers: [:nif, :erlang, :elixir, :app],
|
||||
deps: deps ]
|
||||
deps: deps,
|
||||
dialyzer: dialyzer ]
|
||||
end
|
||||
|
||||
def nif do
|
||||
@@ -131,4 +132,10 @@ defmodule Geef.Mixfile do
|
||||
defp deps do
|
||||
[]
|
||||
end
|
||||
|
||||
def dialyzer do
|
||||
[ plt_apps: [:erts, :kernel, :stdlib, :mnesia],
|
||||
flags: ["-Wunmatched_returns","-Werror_handling","-Wrace_conditions", "-Wno_opaque"]]
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -115,7 +115,7 @@ commit_tree(_Handle) ->
|
||||
commit_create(_RepoHandle, _Ref, _Author, _Committer, _Encoding, _Message, _Tree, _Parents) ->
|
||||
?NIF_FN.
|
||||
|
||||
-spec commit_message(term) -> binary().
|
||||
-spec commit_message(term) -> {ok, binary()} | {error, term()}.
|
||||
commit_message(_CommitHandle) ->
|
||||
?NIF_FN.
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ defmodule IndexTest do
|
||||
use ExUnit.Case
|
||||
use Geef
|
||||
alias Geef.Index
|
||||
alias Geef.Index.Entry
|
||||
import RepoHelpers
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user