Fix clippy suppression in defmt logging#750
Merged
kurtjd merged 1 commit intoOpenDevicePartnership:mainfrom Mar 16, 2026
Merged
Fix clippy suppression in defmt logging#750kurtjd merged 1 commit intoOpenDevicePartnership:mainfrom
kurtjd merged 1 commit intoOpenDevicePartnership:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adjusts the logging macro implementations in embedded-service to avoid clippy-suppression patterns that can unintentionally evaluate logging arguments (and thus cause side effects) when logging is filtered/disabled.
Changes:
- Removed the
let _ = (...)“argument binding” from thedefmt + log(host) macro variants. - Replaced the
let _ = ($s, $( &$x ),*)binding with a no-argument-evaluationlet _ = $s;in thedefmt-only macro variants.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Contributor
|
@damonhunka Can you give this a try to see if it resolves your problem? |
JamesHuard
approved these changes
Mar 16, 2026
jerrysxie
approved these changes
Mar 16, 2026
RobertZ2011
approved these changes
Mar 16, 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.
In #278 I may have been too aggressive in how I was trying to suppress clippy lints stemming from the defmt logging macro. Instead, I just do an empty let binding on the string literal instead of all the arguments, which shouldn't result in any possible side-effects since a string literal should always be able to be optimized away if bound to a
_.Note: The context is that the clippy suppressions introduced are potentially causing adverse side-effects in production code hence the need for this change.