Skip to content

server: fix cargo build warning#160

Merged
jiangliu merged 1 commit intocloud-hypervisor:masterfrom
bergwolf:github/ci
Oct 10, 2023
Merged

server: fix cargo build warning#160
jiangliu merged 1 commit intocloud-hypervisor:masterfrom
bergwolf:github/ci

Conversation

@bergwolf
Copy link
Contributor

clippy doesn't like the solution proposed by rustc. Let's just use the plain if let statement.

error: unused return value of std::option::Option::<T>::map_or that must be used
--> src/api/server/sync_io.rs:93:9
|
93 | hook.map_or((), |h| h.collect(&in_header));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: if you don't need the returned value, use if let instead
= note: -D unused-must-use implied by -D warnings

clippy doesn't like the solution proposed by rustc. Let's just use the
plain if let statement.

error: unused return value of `std::option::Option::<T>::map_or` that must be used
  --> src/api/server/sync_io.rs:93:9
   |
93 |         hook.map_or((), |h| h.collect(&in_header));
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: if you don't need the returned value, use `if let` instead
   = note: `-D unused-must-use` implied by `-D warnings`

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
@jiangliu jiangliu merged commit 116ba46 into cloud-hypervisor:master Oct 10, 2023
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