fix: Fix missing include, update to 0.11.3 #361
clippy macOS-latest
12 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 0 |
Warning | 12 |
Note | 0 |
Help | 0 |
Versions
- rustc 1.73.0 (cc66ad468 2023-10-03)
- cargo 1.73.0 (9c4383fb5 2023-08-26)
- clippy 0.1.73 (cc66ad46 2023-10-03)
Annotations
Check warning on line 291 in src/corebluetooth/central_delegate.rs
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:291:9
|
291 | pub mod CentralDelegate {
| ^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `central_delegate`
|
= note: `#[warn(non_snake_case)]` on by default
Check warning on line 534 in src/corebluetooth/internal.rs
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:518:9
|
518 | / if self.peripherals.contains_key(&uuid) {
519 | | if let Some(name) = name {
520 | | self.dispatch_event(CoreBluetoothEvent::DeviceUpdated { uuid, name })
521 | | .await;
... |
533 | | .await;
534 | | }
| |_________^
|
= 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
|
518 ~ if let std::collections::hash_map::Entry::Vacant(e) = self.peripherals.entry(uuid) {
519 + // Create our channels
520 + let (event_sender, event_receiver) = mpsc::channel(256);
521 + e.insert(CBPeripheral::new(peripheral, event_sender));
522 + self.dispatch_event(CoreBluetoothEvent::DeviceDiscovered {
523 + uuid,
524 + name,
525 + event_receiver,
526 + })
527 + .await;
528 + } else {
529 + if let Some(name) = name {
530 + self.dispatch_event(CoreBluetoothEvent::DeviceUpdated { uuid, name })
531 + .await;
532 + }
533 + }
|
Check warning on line 394 in src/corebluetooth/central_delegate.rs
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:394:19
|
394 | (*(*(&*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 394 in src/corebluetooth/central_delegate.rs
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:394:17
|
394 | (*(*(&*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 382 in src/corebluetooth/central_delegate.rs
github-actions / clippy macOS-latest
use of `unwrap_or_else` to construct default value
warning: use of `unwrap_or_else` to construct default value
--> src/corebluetooth/central_delegate.rs:382:42
|
382 | nsstring_to_string(nsstring).unwrap_or_else(|| "".to_string())
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default
= note: `#[warn(clippy::unwrap_or_default)]` on by default
Check warning on line 314 in src/corebluetooth/central_delegate.rs
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:314:36
|
314 | 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 296 in src/corebluetooth/framework.rs
github-actions / clippy macOS-latest
constant `PERIPHERALSTATE_CONNECTED` is never used
warning: constant `PERIPHERALSTATE_CONNECTED` is never used
--> src/corebluetooth/framework.rs:296:15
|
296 | pub const PERIPHERALSTATE_CONNECTED: c_int = 2; // CBPeripheralStateConnected
| ^^^^^^^^^^^^^^^^^^^^^^^^^
Check warning on line 204 in src/corebluetooth/framework.rs
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:204:9
|
203 | pub enum CBPeripheralState {
| ----------------- variants in this enum
204 | Disonnected = 0,
| ^^^^^^^^^^^
205 | Connecting = 1,
| ^^^^^^^^^^
206 | Connected = 2,
| ^^^^^^^^^
207 | 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 184 in src/corebluetooth/framework.rs
github-actions / clippy macOS-latest
variants `Restricted` and `Denied` are never constructed
warning: variants `Restricted` and `Denied` are never constructed
--> src/corebluetooth/framework.rs:184:9
|
182 | pub enum CBManagerAuthorization {
| ---------------------- variants in this enum
183 | NotDetermined = 0,
184 | Restricted = 1,
| ^^^^^^^^^^
185 | 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 960 in src/corebluetooth/internal.rs
github-actions / clippy macOS-latest
unused variable: `descriptor`
warning: unused variable: `descriptor`
--> src/corebluetooth/internal.rs:960:33
|
960 | 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
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
Check warning on line 25 in src/corebluetooth/internal.rs
github-actions / clippy macOS-latest
unused import: `bleuuid::uuid_from_u16`
warning: unused import: `bleuuid::uuid_from_u16`
--> src/corebluetooth/internal.rs:25:5
|
25 | bleuuid::uuid_from_u16, CharPropFlags, Characteristic, Descriptor, ScanFilter, Service,
| ^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default