mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
pvapconfig: Suppress unnecessary unwrap warning
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 <freude@linux.ibm.com>
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Reviewed-by: Harald Freudenberger <freude@linux.ibm.com>
Signed-off-by: Marc Hartmayer <marc@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
committed by
Jan Höppner
parent
f0a148fd0b
commit
20f6791fb4
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user