Skip to content

Fix misc clippy issues in clicky-core #19

Fix misc clippy issues in clicky-core

Fix misc clippy issues in clicky-core #19

Triggered via pull request May 28, 2024 11:41
Status Success
Total duration 1m 7s
Artifacts

lint.yml

on: pull_request
Matrix: clippy_check
Fit to window
Zoom out
Zoom in

Annotations

11 warnings
this block may be rewritten with the `?` operator: clicky-core/src/devices/generic/ide/mod.rs#L610
warning: this block may be rewritten with the `?` operator --> clicky-core/src/devices/generic/ide/mod.rs:610:21 | 610 | / if let Err(e) = self.blockdev.seek(io::SeekFrom::Start(offset * 512)).await { 611 | | // XXX: actually set error bits 612 | | return Err(e); 613 | | } | |_____________________^ help: replace it with: `self.blockdev.seek(io::SeekFrom::Start(offset * 512)).await?;` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark
this block may be rewritten with the `?` operator: clicky-core/src/devices/generic/ide/mod.rs#L529
warning: this block may be rewritten with the `?` operator --> clicky-core/src/devices/generic/ide/mod.rs:529:21 | 529 | / if let Err(e) = self.blockdev.read_exact(self.iobuf.as_raw()).await { 530 | | // XXX: actually set error bits 531 | | return Err(e); 532 | | } | |_____________________^ help: replace it with: `self.blockdev.read_exact(self.iobuf.as_raw()).await?;` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark
this block may be rewritten with the `?` operator: clicky-core/src/devices/generic/ide/mod.rs#L521
warning: this block may be rewritten with the `?` operator --> clicky-core/src/devices/generic/ide/mod.rs:521:21 | 521 | / if let Err(e) = self.blockdev.seek(io::SeekFrom::Start(offset * 512)).await { 522 | | // XXX: actually set error bits 523 | | return Err(e); 524 | | } | |_____________________^ help: replace it with: `self.blockdev.seek(io::SeekFrom::Start(offset * 512)).await?;` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark
this block may be rewritten with the `?` operator: clicky-core/src/devices/generic/ide/mod.rs#L386
warning: this block may be rewritten with the `?` operator --> clicky-core/src/devices/generic/ide/mod.rs:386:17 | 386 | / if let Err(e) = self.blockdev.write_all(self.iobuf.as_raw()).await { 387 | | // XXX: actually set error bits 388 | | return Err(e); 389 | | } | |_________________^ help: replace it with: `self.blockdev.write_all(self.iobuf.as_raw()).await?;` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark
this block may be rewritten with the `?` operator: clicky-core/src/devices/generic/ide/mod.rs#L334
warning: this block may be rewritten with the `?` operator --> clicky-core/src/devices/generic/ide/mod.rs:334:21 | 334 | / if let Err(e) = self.blockdev.read_exact(self.iobuf.as_raw()).await { 335 | | // XXX: actually set error bits 336 | | return Err(e); 337 | | } | |_____________________^ help: replace it with: `self.blockdev.read_exact(self.iobuf.as_raw()).await?;` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark = note: `#[warn(clippy::question_mark)]` on by default
casting to the same type is unnecessary (`u64` -> `u64`): clicky-core/src/devices/generic/ide/mod.rs#L289
warning: casting to the same type is unnecessary (`u64` -> `u64`) --> clicky-core/src/devices/generic/ide/mod.rs:289:13 | 289 | ((cyl * NUM_HEADS as u64 + head) * NUM_SECTORS as u64 + sector) as u64 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `((cyl * NUM_HEADS as u64 + head) * NUM_SECTORS as u64 + sector)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast = note: `#[warn(clippy::unnecessary_cast)]` on by default
field `0` is never read: clicky-core/src/devices/generic/ide/mod.rs#L167
warning: field `0` is never read --> clicky-core/src/devices/generic/ide/mod.rs:167:18 | 167 | DMAMultiWord(u8), | ------------ ^^ | | | field in this variant | help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field | 167 | DMAMultiWord(()), | ~~
field `0` is never read: clicky-core/src/devices/generic/ide/mod.rs#L166
warning: field `0` is never read --> clicky-core/src/devices/generic/ide/mod.rs:166:19 | 166 | DMASingleWord(u8), | ------------- ^^ | | | field in this variant | help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field | 166 | DMASingleWord(()), | ~~
field `0` is never read: clicky-core/src/devices/generic/ide/mod.rs#L165
warning: field `0` is never read --> clicky-core/src/devices/generic/ide/mod.rs:165:20 | 165 | PioFlowControl(u8), | -------------- ^^ | | | field in this variant | = note: `#[warn(dead_code)]` on by default help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field | 165 | PioFlowControl(()), | ~~
clippy_check (clicky-core)
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions-rs/clippy-check@v1. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
clippy_check (clicky-core)
The following actions uses node12 which is deprecated and will be forced to run on node16: actions-rs/clippy-check@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/