Skip to content

Commit e5e5170

Browse files
committed
Use algebra concat instead of binary concat
1 parent 58e7c6a commit e5e5170

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

lib/elixir/lib/inspect.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ defimpl Inspect, for: BitString do
157157
defp each_bit(bitstring, _counter, opts) do
158158
size = bit_size(bitstring)
159159
<<h::size(size)>> = bitstring
160-
Inspect.Integer.inspect(h, opts) <> "::size(" <> Integer.to_string(size) <> ")"
160+
concat(Inspect.Integer.inspect(h, opts), "::size(" <> Integer.to_string(size) <> ")")
161161
end
162162

163163
@compile {:inline, decrement: 1}

lib/elixir/test/elixir/inspect_test.exs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,10 @@ defmodule Inspect.BitStringTest do
108108

109109
test "bitstring" do
110110
assert inspect(<<1::12-integer-signed>>) == "<<0, 1::size(4)>>"
111+
112+
assert inspect(<<1::12-integer-signed>>, syntax_colors: [number: :blue]) ==
113+
"<<\e[34m0\e[0m, \e[34m1\e[0m::size(4)>>"
114+
111115
assert inspect(<<1, 2, 3, 4, 5>>, pretty: true, width: 10) == "<<1, 2, 3,\n 4, 5>>"
112116
end
113117

0 commit comments

Comments
 (0)