Fix some warnings from mix
This commit is contained in:
@@ -44,10 +44,10 @@ defmodule Geef.Object do
|
|||||||
Tree.get(tree, key)
|
Tree.get(tree, key)
|
||||||
end
|
end
|
||||||
|
|
||||||
def get(tree = %Object{type: :tree}, key) do
|
def get(tree = %Object{type: :tree}, key, default \\ nil) do
|
||||||
case fetch(tree, key) do
|
case fetch(tree, key) do
|
||||||
{:ok, entry} -> entry
|
{:ok, entry} -> entry
|
||||||
{:error, _} -> nil
|
{:error, _} -> default
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -56,4 +56,8 @@ defmodule Geef.Object do
|
|||||||
raise ArgumentError
|
raise ArgumentError
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def pop(_tree, _key) do
|
||||||
|
raise ArgumentError
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
6
mix.exs
6
mix.exs
@@ -54,10 +54,12 @@ defmodule Mix.Tasks.Compile.Nif do
|
|||||||
exts = Keyword.get(config, :exts, [:c])
|
exts = Keyword.get(config, :exts, [:c])
|
||||||
compiler = Keyword.get(config, :compilers, ["cc", "gcc", "clang"]) |> find_compiler
|
compiler = Keyword.get(config, :compilers, ["cc", "gcc", "clang"]) |> find_compiler
|
||||||
|
|
||||||
if cflags = System.get_env("CFLAGS") do
|
flags =
|
||||||
|
case cflags = System.get_env("CFLAGS") do
|
||||||
# FIXME: this isn't going to work too well with quoted spaces
|
# FIXME: this isn't going to work too well with quoted spaces
|
||||||
# inside arguments
|
# inside arguments
|
||||||
flags = [flags, String.split(cflags)]
|
true -> [flags, String.split(cflags)]
|
||||||
|
_ -> flags
|
||||||
end
|
end
|
||||||
|
|
||||||
# Create the directory (e.g. "priv/")
|
# Create the directory (e.g. "priv/")
|
||||||
|
|||||||
Reference in New Issue
Block a user