diff options
author | Bastien Orivel <eijebong@bananium.fr> | 2017-10-09 17:03:40 +0200 |
---|---|---|
committer | Bastien Orivel <eijebong@bananium.fr> | 2017-10-19 15:01:17 +0200 |
commit | e8e2d0a4b24475b018dbc7e59ea46fdceaf20815 (patch) | |
tree | bd56b4a2fc203150ee5c3b5e163937fb3b4e1989 /components/bluetooth | |
parent | 4cf2ce66fc4f970a47ab1fb4b9aa1a55282640f7 (diff) | |
download | servo-e8e2d0a4b24475b018dbc7e59ea46fdceaf20815.tar.gz servo-e8e2d0a4b24475b018dbc7e59ea46fdceaf20815.zip |
Update bitflags to 1.0 in every servo crate
It still needs dependencies update to remove all the other bitflags
versions.
Diffstat (limited to 'components/bluetooth')
-rw-r--r-- | components/bluetooth/Cargo.toml | 2 | ||||
-rw-r--r-- | components/bluetooth/lib.rs | 56 |
2 files changed, 29 insertions, 29 deletions
diff --git a/components/bluetooth/Cargo.toml b/components/bluetooth/Cargo.toml index 5683c7b8150..cdb304e785c 100644 --- a/components/bluetooth/Cargo.toml +++ b/components/bluetooth/Cargo.toml @@ -10,7 +10,7 @@ name = "bluetooth" path = "lib.rs" [dependencies] -bitflags = "0.7" +bitflags = "1.0" bluetooth_traits = {path = "../bluetooth_traits"} device = {git = "https://github.com/servo/devices", features = ["bluetooth-test"]} ipc-channel = "0.9" diff --git a/components/bluetooth/lib.rs b/components/bluetooth/lib.rs index ac41040feff..4da52efc445 100644 --- a/components/bluetooth/lib.rs +++ b/components/bluetooth/lib.rs @@ -47,16 +47,16 @@ const DIALOG_COLUMN_ID: &'static str = "Id"; const DIALOG_COLUMN_NAME: &'static str = "Name"; bitflags! { - flags Flags: u32 { - const BROADCAST = 0b000000001, - const READ = 0b000000010, - const WRITE_WITHOUT_RESPONSE = 0b000000100, - const WRITE = 0b000001000, - const NOTIFY = 0b000010000, - const INDICATE = 0b000100000, - const AUTHENTICATED_SIGNED_WRITES = 0b001000000, - const RELIABLE_WRITE = 0b010000000, - const WRITABLE_AUXILIARIES = 0b100000000, + struct Flags: u32 { + const BROADCAST = 0b000000001; + const READ = 0b000000010; + const WRITE_WITHOUT_RESPONSE = 0b000000100; + const WRITE = 0b000001000; + const NOTIFY = 0b000010000; + const INDICATE = 0b000100000; + const AUTHENTICATED_SIGNED_WRITES = 0b001000000; + const RELIABLE_WRITE = 0b010000000; + const WRITABLE_AUXILIARIES = 0b100000000; } } @@ -522,15 +522,15 @@ impl BluetoothManager { let flags = characteristic.get_flags().unwrap_or(vec!()); for flag in flags { match flag.as_ref() { - "broadcast" => props.insert(BROADCAST), - "read" => props.insert(READ), - "write-without-response" => props.insert(WRITE_WITHOUT_RESPONSE), - "write" => props.insert(WRITE), - "notify" => props.insert(NOTIFY), - "indicate" => props.insert(INDICATE), - "authenticated-signed-writes" => props.insert(AUTHENTICATED_SIGNED_WRITES), - "reliable-write" => props.insert(RELIABLE_WRITE), - "writable-auxiliaries" => props.insert(WRITABLE_AUXILIARIES), + "broadcast" => props.insert(Flags::BROADCAST), + "read" => props.insert(Flags::READ), + "write-without-response" => props.insert(Flags::WRITE_WITHOUT_RESPONSE), + "write" => props.insert(Flags::WRITE), + "notify" => props.insert(Flags::NOTIFY), + "indicate" => props.insert(Flags::INDICATE), + "authenticated-signed-writes" => props.insert(Flags::AUTHENTICATED_SIGNED_WRITES), + "reliable-write" => props.insert(Flags::RELIABLE_WRITE), + "writable-auxiliaries" => props.insert(Flags::WRITABLE_AUXILIARIES), _ => (), } } @@ -747,15 +747,15 @@ impl BluetoothManager { BluetoothCharacteristicMsg { uuid: uuid, instance_id: characteristic.get_id(), - broadcast: properties.contains(BROADCAST), - read: properties.contains(READ), - write_without_response: properties.contains(WRITE_WITHOUT_RESPONSE), - write: properties.contains(WRITE), - notify: properties.contains(NOTIFY), - indicate: properties.contains(INDICATE), - authenticated_signed_writes: properties.contains(AUTHENTICATED_SIGNED_WRITES), - reliable_write: properties.contains(RELIABLE_WRITE), - writable_auxiliaries: properties.contains(WRITABLE_AUXILIARIES), + broadcast: properties.contains(Flags::BROADCAST), + read: properties.contains(Flags::READ), + write_without_response: properties.contains(Flags::WRITE_WITHOUT_RESPONSE), + write: properties.contains(Flags::WRITE), + notify: properties.contains(Flags::NOTIFY), + indicate: properties.contains(Flags::INDICATE), + authenticated_signed_writes: properties.contains(Flags::AUTHENTICATED_SIGNED_WRITES), + reliable_write: properties.contains(Flags::RELIABLE_WRITE), + writable_auxiliaries: properties.contains(Flags::WRITABLE_AUXILIARIES), } ); } |