kata-ctl: Fix clippy question_mark

Manually fix `question_mark` clippy warning reported by rust 1.85.1.

```console
error: this `match` expression can be replaced with `?`
  --> src/ops/check_ops.rs:49:13
   |
49 |       let f = match get_builtin_check_func(check) {
   |  _____________^
50 | |         Ok(fp) => fp,
51 | |         Err(e) => return Err(e),
52 | |     };
   | |_____^ help: try instead: `get_builtin_check_func(check)?`
   |
   = 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>
This commit is contained in:
Ruoqing He 2025-06-05 11:50:53 +00:00
parent 702ba4033e
commit 3d64b11454
2 changed files with 4 additions and 7 deletions

View File

@ -632,9 +632,8 @@ checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724"
[[package]]
name = "cgroups-rs"
version = "0.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6db7c2f5545da4c12c5701455d9471da5f07db52e49b9cccb4f5512226dd0836"
version = "0.3.5"
source = "git+https://github.com/kata-containers/cgroups-rs?rev=v0.3.5#de9625ff57d156967b5b2a637c2c41bb2366e39b"
dependencies = [
"libc",
"log",
@ -3762,6 +3761,7 @@ dependencies = [
"regex",
"rlimit",
"runtime-spec",
"safe-path",
"scan_fmt",
"scopeguard",
"serde",

View File

@ -46,10 +46,7 @@ fn get_builtin_check_func(name: CheckType) -> Result<BuiltinCmdFp> {
// This function is called from each 'kata-ctl check' argument section
fn handle_builtin_check(check: CheckType, args: &str) -> Result<()> {
let f = match get_builtin_check_func(check) {
Ok(fp) => fp,
Err(e) => return Err(e),
};
let f = get_builtin_check_func(check)?;
f(args)
}