Support tvOS, watchOS and visionOS #400
Annotations
22 warnings
format
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v2. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
|
format
The following actions uses node12 which is deprecated and will be forced to run on node16: actions/checkout@v2. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
|
module `CentralDelegate` should have a snake case name:
src/corebluetooth/central_delegate.rs#L289
warning: module `CentralDelegate` should have a snake case name
--> src/corebluetooth/central_delegate.rs:289:9
|
289 | pub mod CentralDelegate {
| ^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `central_delegate`
|
= note: `#[warn(non_snake_case)]` on by default
|
deref which would be done by auto-deref:
src/corebluetooth/internal.rs#L1134
warning: deref which would be done by auto-deref
--> src/corebluetooth/internal.rs:1134:13
|
1134 | &**options,
| ^^^^^^^^^^ help: try: `&options`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref
|
usage of `contains_key` followed by `insert` on a `HashMap`:
src/corebluetooth/internal.rs#L509
warning: usage of `contains_key` followed by `insert` on a `HashMap`
--> src/corebluetooth/internal.rs:509:9
|
509 | / if self.peripherals.contains_key(&uuid) {
510 | | if let Some(name) = name {
511 | | self.dispatch_event(CoreBluetoothEvent::DeviceUpdated {
512 | | uuid,
... |
527 | | .await;
528 | | }
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_entry
= note: `#[warn(clippy::map_entry)]` on by default
help: try
|
509 ~ if let std::collections::hash_map::Entry::Vacant(e) = self.peripherals.entry(uuid) {
510 + // Create our channels
511 + let (event_sender, event_receiver) = mpsc::channel(256);
512 + e.insert(CBPeripheral::new(peripheral, event_sender));
513 + self.dispatch_event(CoreBluetoothEvent::DeviceDiscovered {
514 + uuid,
515 + name: name.map(|name| name.to_string()),
516 + event_receiver,
517 + })
518 + .await;
519 + } else {
520 + if let Some(name) = name {
521 + self.dispatch_event(CoreBluetoothEvent::DeviceUpdated {
522 + uuid,
523 + name: name.to_string(),
524 + })
525 + .await;
526 + }
527 + }
|
|
deref which would be done by auto-deref:
src/corebluetooth/central_delegate.rs#L392
warning: deref which would be done by auto-deref
--> src/corebluetooth/central_delegate.rs:392:17
|
392 | (*(*(&*delegate).get_ivar::<*mut c_void>(DELEGATE_SENDER_IVAR)
| ^^^^^^^^^^^^ help: try: `delegate`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref
= note: `#[warn(clippy::explicit_auto_deref)]` on by default
|
this expression borrows a value the compiler would automatically borrow:
src/corebluetooth/central_delegate.rs#L392
warning: this expression borrows a value the compiler would automatically borrow
--> src/corebluetooth/central_delegate.rs:392:17
|
392 | (*(*(&*delegate).get_ivar::<*mut c_void>(DELEGATE_SENDER_IVAR)
| ^^^^^^^^^^^^ help: change this to: `(*delegate)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
this expression borrows a value the compiler would automatically borrow:
src/corebluetooth/central_delegate.rs#L313
warning: this expression borrows a value the compiler would automatically borrow
--> src/corebluetooth/central_delegate.rs:313:36
|
313 | let _ = Box::from_raw(*(&*delegate).get_ivar::<*mut c_void>(DELEGATE_SENDER_IVAR)
| ^^^^^^^^^^^^ help: change this to: `(*delegate)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
|
constant `PERIPHERALSTATE_CONNECTED` is never used:
src/corebluetooth/framework.rs#L233
warning: constant `PERIPHERALSTATE_CONNECTED` is never used
--> src/corebluetooth/framework.rs:233:15
|
233 | pub const PERIPHERALSTATE_CONNECTED: isize = 2; // CBPeripheralStateConnected
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
variants `Disonnected`, `Connecting`, `Connected`, and `Disconnecting` are never constructed:
src/corebluetooth/framework.rs#L136
warning: variants `Disonnected`, `Connecting`, `Connected`, and `Disconnecting` are never constructed
--> src/corebluetooth/framework.rs:136:9
|
135 | pub enum CBPeripheralState {
| ----------------- variants in this enum
136 | Disonnected = 0,
| ^^^^^^^^^^^
137 | Connecting = 1,
| ^^^^^^^^^^
138 | Connected = 2,
| ^^^^^^^^^
139 | Disconnecting = 3,
| ^^^^^^^^^^^^^
|
= note: `CBPeripheralState` has derived impls for the traits `Debug` and `Clone`, but these are intentionally ignored during dead code analysis
|
variants `Restricted` and `Denied` are never constructed:
src/corebluetooth/framework.rs#L112
warning: variants `Restricted` and `Denied` are never constructed
--> src/corebluetooth/framework.rs:112:9
|
110 | pub enum CBManagerAuthorization {
| ---------------------- variants in this enum
111 | NotDetermined = 0,
112 | Restricted = 1,
| ^^^^^^^^^^
113 | Denied = 2,
| ^^^^^^
|
= note: `CBManagerAuthorization` has derived impls for the traits `Debug` and `Clone`, but these are intentionally ignored during dead code analysis
= note: `#[warn(dead_code)]` on by default
|
use of deprecated method `objc2::runtime::AnyObject::get_mut_ivar`: this is difficult to use correctly, use `Ivar::load_mut` instead.:
src/corebluetooth/central_delegate.rs#L413
warning: use of deprecated method `objc2::runtime::AnyObject::get_mut_ivar`: this is difficult to use correctly, use `Ivar::load_mut` instead.
--> src/corebluetooth/central_delegate.rs:413:23
|
413 | *delegate.get_mut_ivar(DELEGATE_SENDER_IVAR) = sender;
| ^^^^^^^^^^^^
|
use of deprecated method `objc2::runtime::AnyObject::get_ivar`: this is difficult to use correctly, use `Ivar::load` instead.:
src/corebluetooth/central_delegate.rs#L392
warning: use of deprecated method `objc2::runtime::AnyObject::get_ivar`: this is difficult to use correctly, use `Ivar::load` instead.
--> src/corebluetooth/central_delegate.rs:392:30
|
392 | (*(*(&*delegate).get_ivar::<*mut c_void>(DELEGATE_SENDER_IVAR)
| ^^^^^^^^
|
use of deprecated method `objc2::runtime::AnyObject::get_ivar`: this is difficult to use correctly, use `Ivar::load` instead.:
src/corebluetooth/central_delegate.rs#L313
warning: use of deprecated method `objc2::runtime::AnyObject::get_ivar`: this is difficult to use correctly, use `Ivar::load` instead.
--> src/corebluetooth/central_delegate.rs:313:49
|
313 | let _ = Box::from_raw(*(&*delegate).get_ivar::<*mut c_void>(DELEGATE_SENDER_IVAR)
| ^^^^^^^^
|
= note: `#[warn(deprecated)]` on by default
|
unused variable: `descriptor`:
src/corebluetooth/internal.rs#L959
warning: unused variable: `descriptor`
--> src/corebluetooth/internal.rs:959:33
|
959 | if let Some(descriptor) = characteristic.descriptors.get_mut(&descriptor_uuid) {
| ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_descriptor`
|
= note: `#[warn(unused_variables)]` on by default
|
redundant field names in struct initialization:
src/corebluetooth/peripheral.rs#L169
warning: redundant field names in struct initialization
--> src/corebluetooth/peripheral.rs:169:16
|
169 | Self { shared: shared }
| ^^^^^^^^^^^^^^ help: replace it with: `shared`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
= note: `#[warn(clippy::redundant_field_names)]` on by default
|
build (macOS-latest)
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v2, actions-rs/clippy-check@v1. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
|
build (macOS-latest)
The following actions uses node12 which is deprecated and will be forced to run on node16: actions/checkout@v2, actions-rs/clippy-check@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
|
build (ubuntu-latest)
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v2, actions-rs/clippy-check@v1. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
|
build (ubuntu-latest)
The following actions uses node12 which is deprecated and will be forced to run on node16: actions/checkout@v2, actions-rs/clippy-check@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
|
build (windows-latest)
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v2, actions-rs/clippy-check@v1. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
|
build (windows-latest)
The following actions uses node12 which is deprecated and will be forced to run on node16: actions/checkout@v2, actions-rs/clippy-check@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
|