Skip to content

Support tvOS, watchOS and visionOS #400

Support tvOS, watchOS and visionOS

Support tvOS, watchOS and visionOS #400

GitHub Actions / clippy macOS-latest succeeded May 14, 2024

clippy macOS-latest

14 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 0
Warning 14
Note 0
Help 0

Versions

  • rustc 1.77.2 (25ef9e3d8 2024-04-09)
  • cargo 1.77.2 (e52e36006 2024-03-26)
  • clippy 0.1.77 (25ef9e3d 2024-04-09)

Annotations

Check warning on line 289 in src/corebluetooth/central_delegate.rs

See this annotation in the file changed.

@github-actions github-actions / clippy macOS-latest

module `CentralDelegate` should have a snake case name

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

Check warning on line 1134 in src/corebluetooth/internal.rs

See this annotation in the file changed.

@github-actions github-actions / clippy macOS-latest

deref which would be done by auto-deref

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

Check warning on line 528 in src/corebluetooth/internal.rs

See this annotation in the file changed.

@github-actions github-actions / clippy macOS-latest

usage of `contains_key` followed by `insert` on a `HashMap`

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 +         }
    |

Check warning on line 392 in src/corebluetooth/central_delegate.rs

See this annotation in the file changed.

@github-actions github-actions / clippy macOS-latest

deref which would be done by auto-deref

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

Check warning on line 392 in src/corebluetooth/central_delegate.rs

See this annotation in the file changed.

@github-actions github-actions / clippy macOS-latest

this expression borrows a value the compiler would automatically borrow

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

Check warning on line 313 in src/corebluetooth/central_delegate.rs

See this annotation in the file changed.

@github-actions github-actions / clippy macOS-latest

this expression borrows a value the compiler would automatically borrow

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

Check warning on line 233 in src/corebluetooth/framework.rs

See this annotation in the file changed.

@github-actions github-actions / clippy macOS-latest

constant `PERIPHERALSTATE_CONNECTED` is never used

warning: constant `PERIPHERALSTATE_CONNECTED` is never used
   --> src/corebluetooth/framework.rs:233:15
    |
233 |     pub const PERIPHERALSTATE_CONNECTED: isize = 2; // CBPeripheralStateConnected
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^

Check warning on line 136 in src/corebluetooth/framework.rs

See this annotation in the file changed.

@github-actions github-actions / clippy macOS-latest

variants `Disonnected`, `Connecting`, `Connected`, and `Disconnecting` are never constructed

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

Check warning on line 112 in src/corebluetooth/framework.rs

See this annotation in the file changed.

@github-actions github-actions / clippy macOS-latest

variants `Restricted` and `Denied` are never constructed

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

Check warning on line 413 in src/corebluetooth/central_delegate.rs

See this annotation in the file changed.

@github-actions github-actions / clippy macOS-latest

use of deprecated method `objc2::runtime::AnyObject::get_mut_ivar`: this is difficult to use correctly, use `Ivar::load_mut` instead.

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;
    |                       ^^^^^^^^^^^^

Check warning on line 392 in src/corebluetooth/central_delegate.rs

See this annotation in the file changed.

@github-actions github-actions / clippy macOS-latest

use of deprecated method `objc2::runtime::AnyObject::get_ivar`: this is difficult to use correctly, use `Ivar::load` instead.

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)
    |                              ^^^^^^^^

Check warning on line 313 in src/corebluetooth/central_delegate.rs

See this annotation in the file changed.

@github-actions github-actions / clippy macOS-latest

use of deprecated method `objc2::runtime::AnyObject::get_ivar`: this is difficult to use correctly, use `Ivar::load` instead.

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

Check warning on line 959 in src/corebluetooth/internal.rs

See this annotation in the file changed.

@github-actions github-actions / clippy macOS-latest

unused variable: `descriptor`

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

Check warning on line 169 in src/corebluetooth/peripheral.rs

See this annotation in the file changed.

@github-actions github-actions / clippy macOS-latest

redundant field names in struct initialization

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