diff options
author | Kagami Sascha Rosylight <saschanaz@outlook.com> | 2019-11-04 22:42:10 +0900 |
---|---|---|
committer | Kagami Sascha Rosylight <saschanaz@outlook.com> | 2019-11-04 23:39:37 +0900 |
commit | 01e0b2cb5e47c28f7b85483f5ed82a09beb60bb5 (patch) | |
tree | 5318e04be6695f6f16d08767373dd08335af8f12 /components/script/dom/bluetooth.rs | |
parent | 4ad08fff04d974855845bb1bafe10920bfd27a97 (diff) | |
download | servo-01e0b2cb5e47c28f7b85483f5ed82a09beb60bb5.tar.gz servo-01e0b2cb5e47c28f7b85483f5ed82a09beb60bb5.zip |
Use IDL sequence default value
Diffstat (limited to 'components/script/dom/bluetooth.rs')
-rw-r--r-- | components/script/dom/bluetooth.rs | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/components/script/dom/bluetooth.rs b/components/script/dom/bluetooth.rs index 989bcce27b7..fad367bb454 100644 --- a/components/script/dom/bluetooth.rs +++ b/components/script/dom/bluetooth.rs @@ -164,7 +164,7 @@ impl Bluetooth { &self, p: &Rc<Promise>, filters: &Option<Vec<BluetoothLEScanFilterInit>>, - optional_services: &Option<Vec<BluetoothServiceUUID>>, + optional_services: &[BluetoothServiceUUID], sender: IpcSender<BluetoothResponseResult>, ) { // TODO: Step 1: Triggered by user activation. @@ -197,23 +197,21 @@ impl Bluetooth { } let mut optional_services_uuids = vec![]; - if let &Some(ref opt_services) = optional_services { - for opt_service in opt_services { - // Step 2.5 - 2.6. - let uuid = match BluetoothUUID::service(opt_service.clone()) { - Ok(u) => u.to_string(), - Err(e) => { - p.reject_error(e); - return; - }, - }; + for opt_service in optional_services { + // Step 2.5 - 2.6. + let uuid = match BluetoothUUID::service(opt_service.clone()) { + Ok(u) => u.to_string(), + Err(e) => { + p.reject_error(e); + return; + }, + }; - // Step 2.7. - // Note: What we are doing here, is adding the not blocklisted UUIDs to the result vector, - // instead of removing them from an already filled vector. - if !uuid_is_blocklisted(uuid.as_ref(), Blocklist::All) { - optional_services_uuids.push(uuid); - } + // Step 2.7. + // Note: What we are doing here, is adding the not blocklisted UUIDs to the result vector, + // instead of removing them from an already filled vector. + if !uuid_is_blocklisted(uuid.as_ref(), Blocklist::All) { + optional_services_uuids.push(uuid); } } |