Commit Graph

3 Commits

Author SHA1 Message Date
Ruoqing He
e4c5eb90e7 clippy: Fix clippy::question_mark
Fix `clippy::question_mark` warnings reported by clippy 0.1.85
(4d91de4e48 2025-02-17).

```console
error: this `match` expression can be replaced with `?`
  --> vhost-device-can/src/main.rs:77:27
   |
77 |           let can_devices = match parse_can_devices(&args) {
   |  ___________________________^
78 | |             Ok(can_devs) => can_devs,
79 | |             Err(e) => return Err(e),
80 | |         };
   | |_________^ help: try instead: `parse_can_devices(&args)?`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark
   = note: `-D clippy::question-mark` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::question_mark)]`
```

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
2025-03-31 13:45:27 +02:00
Ruoqing He
d43fd79bb7 clippy: Fix clippy::precedence
Fix `clippy::precedence` warnings reported by clippy 0.1.85 (4d91de4e48
2025-02-17).

```console
error: operator precedence can trip the unwary
   --> vhost-device-template/src/vhu_foo.rs:152:9
    |
152 | /         1 << VIRTIO_F_VERSION_1
153 | |             | 1 << VIRTIO_F_NOTIFY_ON_EMPTY
154 | |             | 1 << VIRTIO_RING_F_INDIRECT_DESC
155 | |             | 1 << VIRTIO_RING_F_EVENT_IDX
    | |__________________________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#precedence
    = note: `-D clippy::precedence` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::precedence)]`
help: consider parenthesizing your expression
    |
152 ~         1 << VIRTIO_F_VERSION_1
153 +             | 1 << VIRTIO_F_NOTIFY_ON_EMPTY
154 +             | 1 << VIRTIO_RING_F_INDIRECT_DESC | (1 << VIRTIO_RING_F_EVENT_IDX)
    |
```

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
2025-03-31 13:45:27 +02:00
Timos Ampelikiotis
db63d2057c Move vhost-device-can on main workspace
Changes:
- Update socketcan-rs to v3.3.1 which solve the issue regarding the CANFD messages:
  - https://github.com/socketcan-rs/socketcan-rs/pull/61
- Update Cargo.lock files under main and staging workspace

Signed-off-by: Timos Ampelikiotis <t.ampelikiotis@virtualopensystems.com>
2024-11-14 05:29:54 +02:00