Skip to content

Commit

Permalink
Fix Elixir 1.3 compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
binaryseed committed Jul 19, 2016
1 parent 14edd84 commit 2d317e9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions lib/riffed/client.ex
Original file line number Diff line number Diff line change
Expand Up @@ -114,16 +114,16 @@ defmodule Riffed.Client do
|> Keyword.delete(:host)
|> Keyword.delete(:retries)

if Module.get_attribute(env.module, :auto_import_structs) do
struct_module = quote do
struct_module = if Module.get_attribute(env.module, :auto_import_structs) do
quote do
defmodule unquote(struct_module) do
use Riffed.Struct, unquote(Meta.structs_to_keyword(thrift_metadata))
unquote_splicing(Riffed.Callbacks.reconstitute(env.module))
unquote_splicing(Riffed.Enumeration.reconstitute(env.module))
end
end
else
struct_module = quote do
quote do
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/riffed/macro_helpers.ex
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ defmodule Riffed.MacroHelpers do
|> Enum.map(&build_arg_cast(function_name, struct_module, &1, overrides, cast_function))
end

defp build_arg({index, _type}=arg) do
defp build_arg({index, _type}) do
Macro.var(:"arg_#{abs(index)}", nil)
end

Expand Down
6 changes: 3 additions & 3 deletions lib/riffed/server.ex
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ defmodule Riffed.Server do

structs_keyword = ThriftMeta.Meta.structs_to_keyword(thrift_meta)

if Module.get_attribute(env.module, :auto_import_structs) do
struct_module = quote do
struct_module = if Module.get_attribute(env.module, :auto_import_structs) do
quote do
defmodule unquote(struct_module) do
@build_cast_to_erlang true
use Riffed.Struct, unquote(structs_keyword)
Expand All @@ -190,7 +190,7 @@ defmodule Riffed.Server do
end
end
else
struct_module = quote do
quote do
end
end

Expand Down

0 comments on commit 2d317e9

Please sign in to comment.