Skip to content

Commit

Permalink
Format remaining files
Browse files Browse the repository at this point in the history
  • Loading branch information
pyfisch committed Nov 6, 2018
1 parent bf47f90 commit cb07deb
Show file tree
Hide file tree
Showing 252 changed files with 5,976 additions and 3,776 deletions.
40 changes: 16 additions & 24 deletions components/allocator/lib.rs
Expand Up @@ -30,31 +30,23 @@ mod platform {

// The minimum alignment guaranteed by the architecture. This value is used to
// add fast paths for low alignment values.
#[cfg(
all(
any(
target_arch = "arm",
target_arch = "mips",
target_arch = "mipsel",
target_arch = "powerpc"
)
)
)]
#[cfg(all(any(
target_arch = "arm",
target_arch = "mips",
target_arch = "mipsel",
target_arch = "powerpc"
)))]
const MIN_ALIGN: usize = 8;
#[cfg(
all(
any(
target_arch = "x86",
target_arch = "x86_64",
target_arch = "aarch64",
target_arch = "powerpc64",
target_arch = "powerpc64le",
target_arch = "mips64",
target_arch = "s390x",
target_arch = "sparc64"
)
)
)]
#[cfg(all(any(
target_arch = "x86",
target_arch = "x86_64",
target_arch = "aarch64",
target_arch = "powerpc64",
target_arch = "powerpc64le",
target_arch = "mips64",
target_arch = "s390x",
target_arch = "sparc64"
)))]
const MIN_ALIGN: usize = 16;

fn layout_to_flags(align: usize, size: usize) -> c_int {
Expand Down
15 changes: 9 additions & 6 deletions components/bluetooth/lib.rs
Expand Up @@ -74,7 +74,8 @@ impl BluetoothThreadFactory for IpcSender<BluetoothRequest> {
BluetoothAdapter::init()
} else {
BluetoothAdapter::init_mock()
}.ok();
}
.ok();
thread::Builder::new()
.name("BluetoothThread".to_owned())
.spawn(move || {
Expand Down Expand Up @@ -465,8 +466,10 @@ impl BluetoothManager {
};

services.retain(|s| {
!uuid_is_blocklisted(&s.get_uuid().unwrap_or(String::new()), Blocklist::All) &&
self.allowed_services.get(device_id).map_or(false, |uuids| {
!uuid_is_blocklisted(&s.get_uuid().unwrap_or(String::new()), Blocklist::All) && self
.allowed_services
.get(device_id)
.map_or(false, |uuids| {
uuids.contains(&s.get_uuid().unwrap_or(String::new()))
})
});
Expand Down Expand Up @@ -556,9 +559,9 @@ impl BluetoothManager {
}

fn characteristic_is_cached(&self, characteristic_id: &str) -> bool {
self.cached_characteristics.contains_key(characteristic_id) &&
self.characteristic_to_service
.contains_key(characteristic_id)
self.cached_characteristics.contains_key(characteristic_id) && self
.characteristic_to_service
.contains_key(characteristic_id)
}

// Descriptor
Expand Down
6 changes: 4 additions & 2 deletions components/bluetooth/test.rs
Expand Up @@ -294,14 +294,16 @@ fn create_generic_access_service(
NUMBER_OF_DIGITALS_UUID.to_owned(),
vec![49],
)?;
number_of_digitals_descriptor_1.set_flags(vec![READ_FLAG.to_string(), WRITE_FLAG.to_string()])?;
number_of_digitals_descriptor_1
.set_flags(vec![READ_FLAG.to_string(), WRITE_FLAG.to_string()])?;

let number_of_digitals_descriptor_2 = create_descriptor_with_value(
&device_name_characteristic,
NUMBER_OF_DIGITALS_UUID.to_owned(),
vec![50],
)?;
number_of_digitals_descriptor_2.set_flags(vec![READ_FLAG.to_string(), WRITE_FLAG.to_string()])?;
number_of_digitals_descriptor_2
.set_flags(vec![READ_FLAG.to_string(), WRITE_FLAG.to_string()])?;

// Characteristic User Description Descriptor
let _characteristic_user_description = create_descriptor_with_value(
Expand Down

0 comments on commit cb07deb

Please sign in to comment.