Skip to content

Fix warnings in updated clippy#167

Merged
SebastianSchildt merged 1 commit intoeclipse-kuksa:mainfrom
boschglobal:fix/clippy
Sep 4, 2025
Merged

Fix warnings in updated clippy#167
SebastianSchildt merged 1 commit intoeclipse-kuksa:mainfrom
boschglobal:fix/clippy

Conversation

@SebastianSchildt
Copy link
Contributor

This fixes several clippy issues or compiler warings that triggered clippy to fail such as

warning: struct `DisplayChangeType` is never constructed
   --> databroker-cli/src/sdv_cli.rs:955:8
    |
955 | struct DisplayChangeType(Option<proto::v1::ChangeType>);
    |        ^^^^^^^^^^^^^^^^^
    |
    = note: `#[warn(dead_code)]` on by default

or

warning: hiding a lifetime that's elided elsewhere is confusing
    --> databroker/src/broker.rs:1341:25
     |
1341 |     pub fn iter_entries(&self) -> EntryReadIterator {
     |                         ^^^^^     -----------------
     |                         |         |
     |                         |         the same lifetime is hidden here
     |                         |         the same lifetime is hidden here
     |                         the lifetime is elided here
     |
     = help: the same lifetime is referred to in inconsistent ways, making the signature confusing
     = note: `#[warn(mismatched_lifetime_syntaxes)]` on by default
help: use `'_` for type paths
     |
1341 |     pub fn iter_entries(&self) -> EntryReadIterator<'_> {
     |                                                    ++++

warning: `databroker` (lib) generated 1 warning

As long as we do not fix it, any CI runs will fail, see eg. the currently open dependabot PRs

Signed-off-by: Sebastian Schildt <sebastian.schildt@de.bosch.com>
@codecov
Copy link

codecov bot commented Sep 4, 2025

Codecov Report

❌ Patch coverage is 54.05405% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 62.10%. Comparing base (9f60cdc) to head (e9508e0).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
databroker/src/broker.rs 48.48% 17 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #167      +/-   ##
==========================================
+ Coverage   62.07%   62.10%   +0.02%     
==========================================
  Files          37       37              
  Lines       17095    17088       -7     
==========================================
  Hits        10612    10612              
+ Misses       6483     6476       -7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes several Rust clippy warnings and compiler warnings that were causing CI failures. The changes address lifetime annotation inconsistencies and remove unused code to ensure the codebase passes the updated clippy checks.

  • Added explicit lifetime annotations to function return types to resolve mismatched lifetime syntax warnings
  • Replaced inefficient if-else pattern with match expression for better code clarity
  • Removed unused DisplayChangeType struct and its associated implementation

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
databroker/src/glob.rs Added explicit lifetime annotations to test helper function return types
databroker/src/broker.rs Fixed lifetime annotations and replaced if-else with match expression
databroker-cli/src/sdv_cli.rs Removed unused DisplayChangeType struct and implementation

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@SebastianSchildt SebastianSchildt marked this pull request as ready for review September 4, 2025 11:04
Copy link
Contributor

@rafaeling rafaeling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! thanks!

@SebastianSchildt SebastianSchildt merged commit 00cfc01 into eclipse-kuksa:main Sep 4, 2025
45 of 46 checks passed
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.

2 participants

Comments