aboutsummaryrefslogtreecommitdiffstats
path: root/components/bluetooth/bluetooth.rs
diff options
context:
space:
mode:
authoreri <eri@inventati.org>2024-03-08 00:32:35 +0100
committerGitHub <noreply@github.com>2024-03-07 23:32:35 +0000
commit3b19189896dfa82ce90ac37654bbb585d7ff7efa (patch)
treececbdf6754778af3a6c2b7f0db727e4f22219c72 /components/bluetooth/bluetooth.rs
parent64d013d473105da64ad7671419e805ac0550fc98 (diff)
downloadservo-3b19189896dfa82ce90ac37654bbb585d7ff7efa.tar.gz
servo-3b19189896dfa82ce90ac37654bbb585d7ff7efa.zip
clippy: fix warnings in components/bluetooth (#31566)
Diffstat (limited to 'components/bluetooth/bluetooth.rs')
-rw-r--r--components/bluetooth/bluetooth.rs25
1 files changed, 9 insertions, 16 deletions
diff --git a/components/bluetooth/bluetooth.rs b/components/bluetooth/bluetooth.rs
index f15ae09d0ef..f3c0a7270b1 100644
--- a/components/bluetooth/bluetooth.rs
+++ b/components/bluetooth/bluetooth.rs
@@ -83,8 +83,7 @@ use super::macros::get_inner_and_call;
use super::macros::get_inner_and_call_test_func;
#[cfg(feature = "bluetooth-test")]
-const NOT_SUPPORTED_ON_MOCK_ERROR: &'static str =
- "Error! The first parameter must be a mock structure!";
+const NOT_SUPPORTED_ON_MOCK_ERROR: &str = "Error! The first parameter must be a mock structure!";
#[derive(Debug)]
pub enum BluetoothDiscoverySession {
@@ -193,9 +192,8 @@ impl BluetoothDevice {
#[cfg(feature = "bluetooth-test")]
pub fn set_id(&self, id: String) {
- match self {
- &BluetoothDevice::Mock(ref fake_adapter) => fake_adapter.set_id(id),
- _ => (),
+ if let BluetoothDevice::Mock(fake_adapter) = self {
+ fake_adapter.set_id(id)
}
}
@@ -473,9 +471,8 @@ impl BluetoothGATTService {
#[cfg(feature = "bluetooth-test")]
pub fn set_id(&self, id: String) {
- match self {
- &BluetoothGATTService::Mock(ref fake_service) => fake_service.set_id(id),
- _ => (),
+ if let BluetoothGATTService::Mock(fake_service) = self {
+ fake_service.set_id(id)
}
}
@@ -578,11 +575,8 @@ impl BluetoothGATTCharacteristic {
#[cfg(feature = "bluetooth-test")]
pub fn set_id(&self, id: String) {
- match self {
- &BluetoothGATTCharacteristic::Mock(ref fake_characteristic) => {
- fake_characteristic.set_id(id)
- },
- _ => (),
+ if let BluetoothGATTCharacteristic::Mock(fake_characteristic) = self {
+ fake_characteristic.set_id(id)
}
}
@@ -710,9 +704,8 @@ impl BluetoothGATTDescriptor {
#[cfg(feature = "bluetooth-test")]
pub fn set_id(&self, id: String) {
- match self {
- &BluetoothGATTDescriptor::Mock(ref fake_descriptor) => fake_descriptor.set_id(id),
- _ => (),
+ if let BluetoothGATTDescriptor::Mock(fake_descriptor) = self {
+ fake_descriptor.set_id(id)
}
}