mirror of
https://github.com/kata-containers/kata-containers.git
synced 2026-05-13 02:30:07 +00:00
Manually fix `manual_unwrap_or_default` clippy warning reported by rust
1.85.1.
```console
error: if let can be simplified with `.unwrap_or_default()`
--> src/registry.rs:619:37
|
619 | let mut data: Vec<ImageLayer> = if let Ok(vec) = serde_json::from_reader(read_file) {
| _____________________________________^
620 | | vec
621 | | } else {
... |
624 | | };
| |_____^ help: replace it with: `serde_json::from_reader(read_file).unwrap_or_default()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or_default
= note: `-D clippy::manual-unwrap-or-default` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::manual_unwrap_or_default)]`
```
Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>