From 81ea07b5a78eea97b283c0e793e3632ae356c6ff Mon Sep 17 00:00:00 2001 From: Jiang Liu Date: Tue, 28 Mar 2023 11:19:13 +0800 Subject: [PATCH] nydus: fix a possible panic caused by SubCmdArgs::is_present() Fix a possible panic caused by SubCmdArgs::is_present(). Signed-off-by: Jiang Liu --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 8b49a92156b..3c7fcbb132a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -40,7 +40,7 @@ impl<'a> ServiceArgs for SubCmdArgs<'a> { } fn is_present(&self, key: &str) -> bool { - self.subargs.get_flag(key) || self.args.get_flag(key) + self.subargs.try_get_one::(key).is_ok() || self.args.try_get_one::(key).is_ok() } }