We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9c1543b commit 292ffa3Copy full SHA for 292ffa3
1 file changed
lib/swapi_web/wookiee_encoder.ex
@@ -64,29 +64,11 @@ defmodule SWAPIWeb.WookieeEncoder do
64
defp before_send_callback(%{status: 200} = conn) do
65
wookie_body =
66
conn.resp_body
67
- |> flatten_body()
+ |> IO.iodata_to_binary()
68
|> translate_to_wookiee()
69
70
resp(conn, conn.status, wookie_body)
71
end
72
73
defp before_send_callback(conn), do: conn
74
-
75
- defp flatten_list_improper(list) do
76
- case list do
77
- [] -> []
78
- [h | t] when is_list(h) -> flatten_list_improper(h) ++ flatten_list_improper(t)
79
- [h | t] -> [h | flatten_list_improper(t)]
80
- scalar -> [scalar]
81
- end
82
83
84
- defp flatten_body(list) do
85
- list
86
- |> flatten_list_improper()
87
- |> Enum.map_join("", fn
88
- x when is_integer(x) -> <<x::utf8>>
89
- x -> x
90
- end)
91
92
0 commit comments