Skip to content

Commit

Permalink
Use Atom.to_string instead of multiple format_type function definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
szsoppa committed May 26, 2023
1 parent 6548e2f commit 7bc0610
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/contexted/module_analyzer.ex
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,7 @@ defmodule Contexted.ModuleAnalyzer do
Enum.map_join(types, " | ", &format_type/1)
end

defp format_type({:atom, _, nil}), do: "nil"
defp format_type({:atom, _, atom}), do: ":#{atom}"
defp format_type({:atom, _, atom}), do: ":#{Atom.to_string(atom)}"
defp format_type({:type, _, type_name, _}), do: "#{type_name}()"

defp format_type({:remote_type, _, [{:atom, _, module}, {:atom, _, type}, _list]}) do
Expand Down

0 comments on commit 7bc0610

Please sign in to comment.