From b8f0c56d15f14c4f9f178d92627683e87d8827d1 Mon Sep 17 00:00:00 2001 From: Tamir Duberstein Date: Sat, 15 Mar 2025 18:45:03 -0400 Subject: [PATCH] integration-test: avoid Option::is_some_and These are just pointless. --- test/integration-test/src/tests/info.rs | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/test/integration-test/src/tests/info.rs b/test/integration-test/src/tests/info.rs index 952db96a..700ca936 100644 --- a/test/integration-test/src/tests/info.rs +++ b/test/integration-test/src/tests/info.rs @@ -36,11 +36,7 @@ fn test_loaded_programs() { if let Err(err) = programs.peek().unwrap() { if let ProgramError::SyscallError(err) = &err { // Skip entire test since feature not available - if err - .io_error - .raw_os_error() - .is_some_and(|errno| errno == EINVAL) - { + if err.io_error.raw_os_error() == Some(EINVAL) { eprintln!( "ignoring test completely as `loaded_programs()` is not available on the host" ); @@ -102,10 +98,7 @@ fn test_program_info() { KernelVersion::new(4, 15, 0), ); let maps = test_prog.map_ids().unwrap(); - kernel_assert!( - maps.is_some_and(|ids| ids.is_empty()), - KernelVersion::new(4, 15, 0), - ); + kernel_assert_eq!(maps, Some(Vec::new()), KernelVersion::new(4, 15, 0)); kernel_assert_eq!( Some("simple_prog"), test_prog.name_as_str(), @@ -238,11 +231,7 @@ fn list_loaded_maps() { let mut maps = loaded_maps().peekable(); if let Err(err) = maps.peek().unwrap() { if let MapError::SyscallError(err) = &err { - if err - .io_error - .raw_os_error() - .is_some_and(|errno| errno == EINVAL) - { + if err.io_error.raw_os_error() == Some(EINVAL) { eprintln!( "ignoring test completely as `loaded_maps()` is not available on the host" );