You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(trace-utils): replace use_v05_format bool and remove infallible expect (#1946)
# What does this PR do?
Replaces the `use_v05_format`: bool parameter in `collect_trace_chunks` with the existing TraceEncoding enum, and removes `#[allow(clippy::expect_used)] + .expect("infallible...")` in the v04 msgpack encoder.
# Motivation
Follow-up to [#1896](#1896), addressing review comments:
- Passing a bare bool to `collect_trace_chunks` gave no context at the call site — you had to look up the function signature to understand what true/false meant. Using TraceEncoding makes the intent explicit.
- The `collect_and_process_traces` match had a catch-all arm that computed a bool from the format — replaced with exhaustive V04/V05 arms.
- The v04 encoder used `.expect("infallible...")` with a clippy allow to handle an error that can never occur. Replaced with `let _ = ...`, consistent with what was already done in the v1 encoder.
# Additional Notes
⚠️ Should be merged after [#1896](#1896).
# How to test the change?
Existing tests.
Co-authored-by: anais.raison <anais.raison@datadoghq.com>
0 commit comments