usb_util: fix clippy::unnecessary_get_then_check

Fixes new clippy warning with Rust 1.77

BUG=b:344974550
TEST=tools/clippy

Change-Id: I531655a78f31e94ab6745339186af5c44e95d50d
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5599120
Reviewed-by: Morg <morg@google.com>
Commit-Queue: Morg <morg@google.com>
Auto-Submit: Daniel Verkamp <dverkamp@chromium.org>
This commit is contained in:
Daniel Verkamp 2024-05-16 17:45:29 -07:00 committed by crosvm LUCI
parent c691a7fb4d
commit 35bfbb7403

View file

@ -221,10 +221,9 @@ pub fn parse_usbfs_descriptors(data: &[u8]) -> Result<DeviceDescriptorTree> {
}
for intf_idx in 0..config_descriptor.bNumInterfaces {
if config_descriptor
if !config_descriptor
.interface_descriptors
.get(&(intf_idx, 0))
.is_none()
.contains_key(&(intf_idx, 0))
{
warn!("device interface {} has no interface descriptors", intf_idx);
}