Get rid of some warnings

This commit is contained in:
Carlos Martín Nieto
2014-09-17 04:41:20 +02:00
parent ccc0cc1f80
commit 5362e0c4b6
5 changed files with 8 additions and 8 deletions

View File

@@ -6,11 +6,11 @@ defmodule Geef.Blob do
end end
def size(obj = %Object{type: :blob, handle: handle}) do def size(%Object{type: :blob, handle: handle}) do
:geef_nif.blob_size(handle) :geef_nif.blob_size(handle)
end end
def content(obj = %Object{type: :blob, handle: handle}) do def content(%Object{type: :blob, handle: handle}) do
:geef_nif.blob_content(handle) :geef_nif.blob_content(handle)
end end

View File

@@ -9,12 +9,12 @@ defmodule Geef.Commit do
end end
@spec tree_id(Object.t) :: Oid.t @spec tree_id(Object.t) :: Oid.t
def tree_id(commit = %Object{type: :commit, handle: handle}) do def tree_id(%Object{type: :commit, handle: handle}) do
:geef_nif.commit_tree_id(handle) :geef_nif.commit_tree_id(handle)
end end
@spec tree(t) :: {:ok, Tree.t} | {:error, any} @spec tree(t) :: {:ok, Tree.t} | {:error, any}
def tree(commit = %Object{type: :commit, handle: handle}) do def tree(%Object{type: :commit, handle: handle}) do
case :geef_nif.commit_tree(handle) do case :geef_nif.commit_tree(handle) do
{:ok, id, handle} -> {:ok, id, handle} ->
{:ok, %Object{type: :tree, id: id, handle: handle}} {:ok, %Object{type: :tree, id: id, handle: handle}}

View File

@@ -14,7 +14,7 @@ defmodule Geef.Index.Entry do
%Geef.Index.Entry{unquote_splicing(pairs)} %Geef.Index.Entry{unquote_splicing(pairs)}
end end
def to_record(e = %Geef.Index.Entry{unquote_splicing(pairs)}) do def to_record(_ = %Geef.Index.Entry{unquote_splicing(pairs)}) do
{:geef_index_entry, unquote_splicing(vals)} {:geef_index_entry, unquote_splicing(vals)}
end end

View File

@@ -14,8 +14,8 @@ defmodule Geef.Object do
def lookup(repo, id, type) do def lookup(repo, id, type) do
case lookup(repo, id) do case lookup(repo, id) do
{:ok, obj} -> {:ok, obj = %Geef.Object{type: ^type}} ->
{:ok, obj = %Geef.Object{type: type}} {:ok, obj}
error -> error ->
error error
end end

View File

@@ -6,7 +6,7 @@ defmodule Geef.Tag do
Object.lookup(repo, id, :tag) Object.lookup(repo, id, :tag)
end end
def peel(tag = %Object{type: :tag, handle: handle}) do def peel(%Object{type: :tag, handle: handle}) do
case :geef_nif.tag_peel(handle) do case :geef_nif.tag_peel(handle) do
{:ok, type, id, peeled_handle} -> {:ok, type, id, peeled_handle} ->
{:ok, %Object{type: type, id: id, handle: peeled_handle}} {:ok, %Object{type: type, id: id, handle: peeled_handle}}