fix(clippy): fix cargo clippy warnings
This commit is contained in:
@@ -8,15 +8,12 @@ pub(crate) async fn find_connected_airpods(adapter: &Adapter) -> bluer::Result<b
|
||||
let addrs = adapter.device_addresses().await?;
|
||||
for addr in addrs {
|
||||
let device = adapter.device(addr)?;
|
||||
if device.is_connected().await.unwrap_or(false) {
|
||||
if let Ok(uuids) = device.uuids().await {
|
||||
if let Some(uuids) = uuids {
|
||||
if uuids.iter().any(|u| *u == target_uuid) {
|
||||
if device.is_connected().await.unwrap_or(false)
|
||||
&& let Ok(uuids) = device.uuids().await
|
||||
&& let Some(uuids) = uuids
|
||||
&& uuids.iter().any(|u| *u == target_uuid) {
|
||||
return Ok(device);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Err(bluer::Error::from(Error::new(std::io::ErrorKind::NotFound, "No connected AirPods found")))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user