Skip to content

Commit affbd82

Browse files
committed
Remove extra clauses
1 parent 1b87dc8 commit affbd82

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

lib/formatter.ex

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -216,18 +216,11 @@ defmodule Jason.Formatter do
216216
{output_acc, &pp_string(&1, &2, in_bs, cont)}
217217
end
218218

219-
defp pp_string(<<byte, rest::binary>>, output_acc, true = _in_bs, cont) do
219+
defp pp_string(binary, output_acc, true = _in_bs, cont) when is_binary(binary) do
220+
<<byte, rest::binary>> = binary
220221
pp_string(rest, [output_acc, byte], false, cont)
221222
end
222223

223-
defp pp_string(<<?", rest::binary>>, output_acc, false = _in_bs, cont) do
224-
cont.(rest, [output_acc, ?"])
225-
end
226-
227-
defp pp_string(<<?\\, rest::binary>>, output_acc, false = _in_bs, cont) do
228-
pp_string(rest, [output_acc, ?\\], true, cont)
229-
end
230-
231224
defp pp_string(binary, output_acc, false = _in_bs, cont) when is_binary(binary) do
232225
case :binary.match(binary, ["\"", "\\"]) do
233226
:nomatch ->

0 commit comments

Comments
 (0)