Fix clippy warnings with new rust version, and upgrade rust version in CI#3556
Merged
stevenengler merged 8 commits intoshadow:mainfrom Apr 7, 2025
Merged
Fix clippy warnings with new rust version, and upgrade rust version in CI#3556stevenengler merged 8 commits intoshadow:mainfrom
stevenengler merged 8 commits intoshadow:mainfrom
Conversation
```text
warning: the following explicit lifetimes could be elided: 'a
--> lib/vasi-sync/src/scmutex.rs:255:24
|
255 | pub fn lock_pinned<'a>(self: Pin<&'a Self>) -> Pin<SelfContainedMutexGuard<'a, T>> {
| ^^ ^^ ^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
= note: `#[warn(clippy::needless_lifetimes)]` on by default
help: elide the lifetimes
|
255 - pub fn lock_pinned<'a>(self: Pin<&'a Self>) -> Pin<SelfContainedMutexGuard<'a, T>> {
255 + pub fn lock_pinned(self: Pin<&Self>) -> Pin<SelfContainedMutexGuard<'_, T>> {
```
```text
warning: manual implementation of `err`
--> test/test_utils.rs:595:25
|
595 | .filter_map(|v| match v {
| _________________________^
596 | | Err(verify) => Some(verify),
597 | | _ => None,
598 | | })
| |_________^ help: replace with: `v.err()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_ok_err
= note: `#[warn(clippy::manual_ok_err)]` on by default
```
```text warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator --> test/environment/test_env.rs:25:24 | 25 | assert!(ld_preload.last().unwrap() == "/my/custom/ld/preload/path.so"); | ^^^^^^ help: try: `next_back()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last = note: `#[warn(clippy::double_ended_iterator_last)]` on by default ```
```text warning: this `repeat().take()` can be written more concisely --> main/utility/byte_queue.rs:70:29 | 70 | BytesMut::from_iter(std::iter::repeat(0).take(size)) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `repeat_n()` instead: `std::iter::repeat_n(0, size)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_repeat_n = note: `#[warn(clippy::manual_repeat_n)]` on by default ```
```text
warning: length comparison to zero
--> main/host/process.rs:331:46
|
331 | if !clear_child_tid_pvp.is_null() && self.threads.borrow().len() > 0 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!self.threads.borrow().is_empty()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero
= note: `#[warn(clippy::len_zero)]` on by default
```
```text
warning: doc list item overindented
--> main/core/work/task.rs:185:9
|
185 | /// for `HostTreePointer::new`.
| ^^^ help: try using ` ` (2 spaces)
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_overindented_list_items
= note: `#[warn(clippy::doc_overindented_list_items)]` on by default
```
sporksmith
approved these changes
Apr 7, 2025
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.
No description provided.