chore: fix clippy warnings#147
Merged
Merged
Conversation
duncanpharvey
marked this pull request as ready for review
July 17, 2026 14:57
duncanpharvey
requested review from
apiarian-datadog and
jchrostek-dd
and removed request for
a team
July 17, 2026 14:57
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses Rust Clippy warnings in the DogStatsD crate, keeping CI green under -D warnings while preserving existing behavior.
Changes:
- Simplified
parse_metric_namespacecontrol flow by using the?operator for early-return on missing first character. - Removed redundant borrows in
format!calls when constructing Datadog intake URLs.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| crates/dogstatsd/src/util.rs | Refactors namespace parsing to use ? for Option early-return and satisfy Clippy. |
| crates/dogstatsd/src/datadog/shipping.rs | Cleans up format! argument borrowing to satisfy Clippy. |
Comments suppressed due to low confidence (1)
crates/dogstatsd/src/datadog/shipping.rs:50
trace!("Sending body: {:?}", series)logs the full metrics payload. Metric tags/names can contain customer identifiers; logging the full payload risks leaking sensitive data and can be very noisy. Prefer logging only counts/sizes.
let safe_body = serde_json::to_vec(&series)
.map_err(|e| ShippingError::Payload(format!("Failed to serialize series: {e}")))?;
trace!("Sending body: {:?}", &series);
self.ship_data(url, safe_body, "application/json").await
Lewis-E
approved these changes
Jul 17, 2026
kathiehuang
approved these changes
Jul 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Fixes clippy warnings.
Motivation
https://github.com/DataDog/serverless-components/actions/runs/29588791501/job/87912458431?pr=146
Additional Notes
Describe how to test/QA your changes