Skip to content

Use pin operator when matching binary in formatters/datadog.ex - #171

Merged
AndrewDryga merged 1 commit into
Nebo15:masterfrom
weih-kahoot:fix-warning-on-binary-matching
Jul 2, 2026
Merged

Use pin operator when matching binary in formatters/datadog.ex#171
AndrewDryga merged 1 commit into
Nebo15:masterfrom
weih-kahoot:fix-warning-on-binary-matching

Conversation

@weih-kahoot

Copy link
Copy Markdown
Contributor

When compiled under Elixir 1.20, there is following warning:

 warning: the variable "len" is accessed inside size(...) of a bitstring but it was defined outside of the match. You must precede it with the pin operator
 │

230 │ <<_front::binary-size(len), value::binary>> = value
│ ~

└─ lib/logger_json/formatters/datadog.ex:230:27: LoggerJSON.Formatters.Datadog.convert_otel_field/1

When compiled under Elixir 1.20, there is following warning:

     warning: the variable "len" is accessed inside size(...) of a bitstring but it was defined outside of the match. You must precede it with the pin operator
     │
 230 │     <<_front::binary-size(len), value::binary>> = value
     │                           ~
     │
     └─ lib/logger_json/formatters/datadog.ex:230:27: LoggerJSON.Formatters.Datadog.convert_otel_field/1
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 100.0%. remained the same — weih-kahoot:fix-warning-on-binary-matching into Nebo15:master

@AndrewDryga
AndrewDryga merged commit cb2abef into Nebo15:master Jul 2, 2026
7 checks passed
@AndrewDryga

Copy link
Copy Markdown
Member

Thank you ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants