Skip to content

Commit

Permalink
Fix warnings for new, defs.. in Elixir 1.4 (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
tony612 authored and bitwalker committed Jan 5, 2017
1 parent 8df31e0 commit 6c9b76d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/exprotobuf/define_message.ex
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ defmodule Protobuf.DefineMessage do
quote location: :keep do
def new(), do: struct(unquote(name))
def new(values) when is_list(values) do
Enum.reduce(values, new, fn
Enum.reduce(values, new(), fn
{key, value}, obj ->
if Map.has_key?(obj, key) do
Map.put(obj, key, value)
Expand All @@ -83,7 +83,7 @@ defmodule Protobuf.DefineMessage do
defp encode_decode(_name) do
quote do
def decode(data), do: Decoder.decode(data, __MODULE__)
def encode(%{} = record), do: Encoder.encode(record, defs)
def encode(%{} = record), do: Encoder.encode(record, defs())
def decode_delimited(bytes), do: Delimited.decode(bytes, __MODULE__)
def encode_delimited(messages), do: Delimited.encode(messages)
end
Expand Down
2 changes: 1 addition & 1 deletion test/utils/gpb_compile_helper.exs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ defmodule GpbCompileHelper do
end

def compile_tmp_proto(msgs, options, func) do
compile_tmp_proto(msgs, options, find_unused_module, func)
compile_tmp_proto(msgs, options, find_unused_module(), func)
end

def compile_tmp_proto(msgs, options, module, func) do
Expand Down

0 comments on commit 6c9b76d

Please sign in to comment.