Skip to content

Commit

Permalink
Fix style
Browse files Browse the repository at this point in the history
  • Loading branch information
msoedov committed Jun 21, 2017
1 parent 33ca01e commit dcc834a
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions lib/options.ex
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ defmodule Firex.Options do
:float - parses the value as a float
:string - parses the value as a string
"""

def to_op_types([{:spec, {:::, _, [{_name, _line, types}|_]}, _}|_aliases]) do
translation = %{:String => :string, :Bool => :boolean, :Integer => :integer, :Float => :float}
type_trans = fn x ->
Expand All @@ -25,14 +24,14 @@ defmodule Firex.Options do
_ -> nil
end
end
case types do
nil -> []
_ -> types
|> Enum.map(type_trans)
|> Enum.map(fn atom -> Map.get(translation, atom, :string) end)
if types do
types
|> Enum.map(type_trans)
|> Enum.map(fn atom -> Map.get(translation, atom, :string) end)
else
[]
end
end

def to_op_types(_) do
[]
end
Expand Down

0 comments on commit dcc834a

Please sign in to comment.