Skip to content

misc: Fix Clippy hints - #194

Merged
phip1611 merged 3 commits into
cyberus-technology:gardenlinuxfrom
scholzp:fix_clippy_hints
Aug 25, 2026
Merged

misc: Fix Clippy hints#194
phip1611 merged 3 commits into
cyberus-technology:gardenlinuxfrom
scholzp:fix_clippy_hints

Conversation

@scholzp

@scholzp scholzp commented Aug 24, 2026

Copy link
Copy Markdown

Somehow my other PR (#190) raised some Clippy hints on code it never touched.

Here is the backport of the corresponding upstream PR. The backport contains only parts relevant to us. This means:

  • I removed changes to qcow_raw_file.rs from the first commit, as we deleted the file
  • I removed the second commit of the series as it only affects code that is upstream
  • I modified the third commit of the series (which is the second commit in this PR) to remove an import not used in our code.

@phip1611

Copy link
Copy Markdown
Member

Probably because of the new rust (thus clippy) version released just the other day

@arctic-alpaca arctic-alpaca left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Could you cherry pick the upstream commits for this instead?

cloud-hypervisor@52f5d5f
cloud-hypervisor@f5468a6

@phip1611

phip1611 commented Aug 25, 2026

Copy link
Copy Markdown
Member

Pascal is OOO today according to the team calendar

@phip1611 phip1611 closed this Aug 25, 2026
@phip1611 phip1611 reopened this Aug 25, 2026
@phip1611

phip1611 commented Aug 25, 2026

Copy link
Copy Markdown
Member

Reopening, as Pascal cancelled his vacation. Please fix this today so we can move forward.

@scholzp

scholzp commented Aug 25, 2026

Copy link
Copy Markdown
Author

I'm on it.

```
warning: using `chunks_exact` with a constant chunk size
   --> block/src/formats/qcow/internal/header.rs:253:39
    |
253 |                     for entry in data.chunks_exact(FEATURE_NAME_ENTRY_SIZE) {
    |                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `as_chunks` instead
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#chunks_exact_to_as_chunks
    = note: `-D clippy::chunks-exact-to-as-chunks` implied by `-D clippy::all`
```

Signed-off-by: Rob Bradford <rbradford@meta.com>
scholzp and others added 2 commits August 25, 2026 10:27
```
warning: you seem to be trying to move all elements into a new `Vec`
   --> pci/src/configuration.rs:951:24
    |
951 |                 return self.pending_bar_reprogram.drain(..).collect();
    |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `mem::take` to avoid creating a new allocation: `std::mem::take(&mut self.pending_bar_reprogram)`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#drain_collect
    = note: `-D clippy::drain-collect` implied by `-D clippy::all`
```

Signed-off-by: Rob Bradford <rbradford@meta.com>
On-behalf-of: SAP pascal.scholz@sap.com
Signed-off-by: Pascal Scholz <pascal.scholz@cyberus-technology.de>
```
warning: unneeded late initialization
   --> devices/src/legacy/gpio_pl061.rs:258:9
    |
258 |         let value;
    |         ^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init
    = note: `-D clippy::needless-late-init` implied by `-D clippy::all`
```

Signed-off-by: Rob Bradford <rbradford@meta.com>
@scholzp

scholzp commented Aug 25, 2026

Copy link
Copy Markdown
Author

I backported the upstream commits and updated the PR's description accordingly.

@scholzp
scholzp requested a review from arctic-alpaca August 25, 2026 08:44

@phip1611 phip1611 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

fantastic PR!

@phip1611
phip1611 merged commit ff49393 into cyberus-technology:gardenlinux Aug 25, 2026
19 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.

4 participants