Hello,
I am still an Elixir newbie. To learn I keep on asking questions like this…
Can I improve this two functions? It feels like but I do not know how.
defp get_url(team_id) when team_id > 0 do
"a_url_removed_because_not_public" <>
Kernel.inspect(team_id)
end
defp get_url(team_id) when team_id == 0 do
"a_url_removed_because_not_public"
end
besides doing them as one-liners:
defp get_url(team_id) when team_id > 0; do: "a_url_removed_because_not_public" <> Kernel.inspect(team_id)
defp get_url(team_id) when team_id == 0; do: "a_url_removed_because_not_public"
It still looks as it contains too much redundant code.






















