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 c6ec30d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 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
7 changes: 4 additions & 3 deletions lib/riffed/struct.ex
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,10 @@ defmodule Riffed.Struct do
callbacks = Riffed.Callbacks.build(env.module)
enums = Riffed.Enumeration.build(env.module)

erlang_casts = []
if build_cast_to_erlang do
erlang_casts = Riffed.Enumeration.build_cast_return_value_to_erlang(env.module)
erlang_casts = if build_cast_to_erlang do
Riffed.Enumeration.build_cast_return_value_to_erlang(env.module)
else
[]
end

quote do
Expand Down

0 comments on commit c6ec30d

Please sign in to comment.