Skip to content

Commit

Permalink
Bluetooth_scanfilter fix
Browse files Browse the repository at this point in the history
  • Loading branch information
fokinv committed Nov 2, 2016
1 parent 3676df3 commit 50556d8
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions components/net_traits/bluetooth_scanfilter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,7 @@ impl BluetoothScanfilter {
}

pub fn get_name(&self) -> Option<&str> {
match &self.name {
&Some(ref name) => Some(name.as_str()),
&None => None,
}
self.name.as_ref().map(|s| s.as_str())
}

pub fn get_name_prefix(&self) -> &str {
Expand All @@ -77,8 +74,8 @@ impl BluetoothScanfilter {
self.get_services().is_empty() &&
self.manufacturer_id.is_none() &&
self.service_data_uuid.is_empty()) ||
self.get_name().unwrap_or("").len() > MAX_NAME_LENGTH ||
self.name_prefix.len() > MAX_NAME_LENGTH
self.get_name().unwrap_or("").len() > MAX_NAME_LENGTH ||
self.name_prefix.len() > MAX_NAME_LENGTH
}
}

Expand Down

0 comments on commit 50556d8

Please sign in to comment.