Skip to content

Commit 366c643

Browse files
Do not reinvent the wheel
the CSV library already implements the protocol in question. (cherry picked from commit 0555f1f) Conflicts: deps/rabbitmq_cli/lib/rabbitmq/cli/formatters/csv.ex
1 parent d959b4f commit 366c643

File tree

1 file changed

+0
-36
lines changed
  • deps/rabbitmq_cli/lib/rabbitmq/cli/formatters

1 file changed

+0
-36
lines changed

deps/rabbitmq_cli/lib/rabbitmq/cli/formatters/csv.ex

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -93,39 +93,3 @@ defmodule RabbitMQ.CLI.Formatters.Csv do
9393
other
9494
end
9595
end
96-
97-
# Elixir 1.15 compiler optimizations require that we explicitly
98-
# add the csv code path
99-
true = Code.append_path(Path.join(["..", "csv", "ebin"]))
100-
101-
defimpl CSV.Encode, for: PID do
102-
def encode(pid, env \\ []) do
103-
FormatterHelpers.format_info_item(pid)
104-
|> to_string
105-
|> CSV.Encode.encode(env)
106-
end
107-
end
108-
109-
defimpl CSV.Encode, for: List do
110-
def encode(list, env \\ []) do
111-
FormatterHelpers.format_info_item(list)
112-
|> to_string
113-
|> CSV.Encode.encode(env)
114-
end
115-
end
116-
117-
defimpl CSV.Encode, for: Tuple do
118-
def encode(tuple, env \\ []) do
119-
FormatterHelpers.format_info_item(tuple)
120-
|> to_string
121-
|> CSV.Encode.encode(env)
122-
end
123-
end
124-
125-
defimpl CSV.Encode, for: Map do
126-
def encode(map, env \\ []) do
127-
FormatterHelpers.format_info_item(map)
128-
|> to_string
129-
|> CSV.Encode.encode(env)
130-
end
131-
end

0 commit comments

Comments
 (0)