doc: Roll version/CHANGELOG for 0.11.4 #380
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.74.1 (a28077b28 2023-12-04)
- cargo 1.74.1 (ecb9851af 2023-10-18)
- clippy 0.1.74 (a28077b2 2023-12-04)
Annotations
Check warning on line 296 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:296:9
|
296 | 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 399 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:399:17
|
399 | (*(*(&*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 399 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:399:17
|
399 | (*(*(&*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 387 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:387:42
|
387 | 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 319 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:319:36
|
319 | 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 305 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:305:15
|
305 | pub const PERIPHERALSTATE_CONNECTED: c_int = 2; // CBPeripheralStateConnected
| ^^^^^^^^^^^^^^^^^^^^^^^^^
Check warning on line 213 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:213:9
|
212 | pub enum CBPeripheralState {
| ----------------- variants in this enum
213 | Disonnected = 0,
| ^^^^^^^^^^^
214 | Connecting = 1,
| ^^^^^^^^^^
215 | Connected = 2,
| ^^^^^^^^^
216 | 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 193 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:193:9
|
191 | pub enum CBManagerAuthorization {
| ---------------------- variants in this enum
192 | NotDetermined = 0,
193 | Restricted = 1,
| ^^^^^^^^^^
194 | 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 965 in src/corebluetooth/internal.rs
github-actions / clippy macOS-latest
unused variable: `descriptor`
warning: unused variable: `descriptor`
--> src/corebluetooth/internal.rs:965:33
|
965 | 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