aboutsummaryrefslogtreecommitdiffstats
path: root/components/bluetooth_traits
diff options
context:
space:
mode:
authorTeymour Aldridge <teymour@reasoning.page>2022-08-04 00:13:36 +0800
committerTeymour Aldridge <teymour@reasoning.page>2022-08-04 00:13:36 +0800
commit3e5cd8815da2ef649658e45f949e29308d1bb853 (patch)
tree9e75f10566e8d589dad7238b235d3619c2c0b9a9 /components/bluetooth_traits
parentc23adde5a33348aa38f7c2ad22bf96d91dcc7b33 (diff)
downloadservo-3e5cd8815da2ef649658e45f949e29308d1bb853.tar.gz
servo-3e5cd8815da2ef649658e45f949e29308d1bb853.zip
Fix some Clippy lints.
Diffstat (limited to 'components/bluetooth_traits')
-rw-r--r--components/bluetooth_traits/blocklist.rs9
-rw-r--r--components/bluetooth_traits/scanfilter.rs8
2 files changed, 8 insertions, 9 deletions
diff --git a/components/bluetooth_traits/blocklist.rs b/components/bluetooth_traits/blocklist.rs
index 836890fb435..94df49af428 100644
--- a/components/bluetooth_traits/blocklist.rs
+++ b/components/bluetooth_traits/blocklist.rs
@@ -8,10 +8,9 @@ use std::cell::RefCell;
use std::collections::HashMap;
use std::string::String;
-const EXCLUDE_READS: &'static str = "exclude-reads";
-const EXCLUDE_WRITES: &'static str = "exclude-writes";
-const VALID_UUID_REGEX: &'static str =
- "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}";
+const EXCLUDE_READS: &str = "exclude-reads";
+const EXCLUDE_WRITES: &str = "exclude-writes";
+const VALID_UUID_REGEX: &str = "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}";
thread_local!(pub static BLUETOOTH_BLOCKLIST: RefCell<BluetoothBlocklist> =
RefCell::new(BluetoothBlocklist(parse_blocklist())));
@@ -108,5 +107,5 @@ fn parse_blocklist() -> Option<HashMap<String, Blocklist>> {
result.insert(uuid.to_string(), exclude_type);
}
// Step 5
- return Some(result);
+ Some(result)
}
diff --git a/components/bluetooth_traits/scanfilter.rs b/components/bluetooth_traits/scanfilter.rs
index a37733bfa4e..29e6667f8f6 100644
--- a/components/bluetooth_traits/scanfilter.rs
+++ b/components/bluetooth_traits/scanfilter.rs
@@ -44,16 +44,16 @@ impl BluetoothScanfilter {
service_data: Option<ServiceData>,
) -> BluetoothScanfilter {
BluetoothScanfilter {
- name: name,
- name_prefix: name_prefix,
+ name,
+ name_prefix,
services: ServiceUUIDSequence::new(services),
manufacturer_data: manufacturer_data,
- service_data: service_data,
+ service_data,
}
}
pub fn get_name(&self) -> Option<&str> {
- self.name.as_ref().map(|s| s.as_str())
+ self.name.as_deref()
}
pub fn get_name_prefix(&self) -> &str {