From 20f6791fb485c51a2cd20cc46da5949c1aa51fe3 Mon Sep 17 00:00:00 2001 From: Marc Hartmayer Date: Fri, 19 Jun 2026 11:19:21 +0200 Subject: [PATCH] pvapconfig: Suppress unnecessary unwrap warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The current code is easier to read as the suggested fix by Clippy. Therefore adding directives to allow the unwrap. warning: called `unwrap` on `a1.info` after checking its variant with `is_some` --> pvapconfig/src/ap.rs:195:36 | 192 | && a1.info.is_some() | ----------------- the check is happening here ... 195 | let i1 = match a1.info.as_ref().unwrap() { | ^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: try using `match` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap = note: `#[warn(clippy::unnecessary_unwrap)]` on by default warning: called `unwrap` on `a2.info` after checking its variant with `is_some` --> pvapconfig/src/ap.rs:199:36 | 193 | && a2.info.is_some() | ----------------- the check is happening here ... 199 | let i2 = match a2.info.as_ref().unwrap() { | ^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: try using `match` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap Suggested-by: Harald Freudenberger Reviewed-by: Steffen Eiden Reviewed-by: Harald Freudenberger Signed-off-by: Marc Hartmayer Signed-off-by: Jan Höppner --- rust/pvapconfig/src/ap.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rust/pvapconfig/src/ap.rs b/rust/pvapconfig/src/ap.rs index 4ac2cd97..76798e26 100644 --- a/rust/pvapconfig/src/ap.rs +++ b/rust/pvapconfig/src/ap.rs @@ -192,10 +192,12 @@ impl ApqnList { && a1.info.is_some() && a2.info.is_some() { + #[allow(clippy::unnecessary_unwrap)] let i1 = match a1.info.as_ref().unwrap() { apqn_info::Ep11(i) => i, _ => continue, }; + #[allow(clippy::unnecessary_unwrap)] let i2 = match a2.info.as_ref().unwrap() { apqn_info::Ep11(i) => i, _ => continue,