remove device invalidity checks from property accessors

accessing those properties is always fine
This commit is contained in:
teoxoy 2024-06-19 12:28:08 +02:00 committed by Teodor Tanasoaia
parent 3e44a98088
commit 508ece312d

View File

@ -105,9 +105,6 @@ impl Global {
let hub = A::hub(self); let hub = A::hub(self);
let device = hub.devices.get(device_id).map_err(|_| InvalidDevice)?; let device = hub.devices.get(device_id).map_err(|_| InvalidDevice)?;
if !device.is_valid() {
return Err(InvalidDevice);
}
Ok(device.features) Ok(device.features)
} }
@ -119,9 +116,6 @@ impl Global {
let hub = A::hub(self); let hub = A::hub(self);
let device = hub.devices.get(device_id).map_err(|_| InvalidDevice)?; let device = hub.devices.get(device_id).map_err(|_| InvalidDevice)?;
if !device.is_valid() {
return Err(InvalidDevice);
}
Ok(device.limits.clone()) Ok(device.limits.clone())
} }
@ -133,9 +127,6 @@ impl Global {
let hub = A::hub(self); let hub = A::hub(self);
let device = hub.devices.get(device_id).map_err(|_| InvalidDevice)?; let device = hub.devices.get(device_id).map_err(|_| InvalidDevice)?;
if !device.is_valid() {
return Err(InvalidDevice);
}
Ok(device.downlevel.clone()) Ok(device.downlevel.clone())
} }