Fix #227, use BluetoothCacheMode::Uncached when discovering services for #456
clippy macOS-latest
13 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 0 |
Warning | 13 |
Note | 0 |
Help | 0 |
Versions
- rustc 1.83.0 (90b35a623 2024-11-26)
- cargo 1.83.0 (5ffbef321 2024-10-29)
- clippy 0.1.83 (90b35a62 2024-11-26)
Annotations
Check warning on line 606 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:587:9
|
587 | / if self.peripherals.contains_key(&uuid) {
588 | | if let Some(name) = name {
589 | | self.dispatch_event(CoreBluetoothEvent::DeviceUpdated {
590 | | uuid,
... |
605 | | .await;
606 | | }
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_entry
help: try
|
587 ~ if let std::collections::hash_map::Entry::Vacant(e) = self.peripherals.entry(uuid) {
588 + // Create our channels
589 + let (event_sender, event_receiver) = mpsc::channel(256);
590 + e.insert(PeripheralInternal::new(peripheral, event_sender));
591 + self.dispatch_event(CoreBluetoothEvent::DeviceDiscovered {
592 + uuid,
593 + name: name.map(|name| name.to_string()),
594 + event_receiver,
595 + })
596 + .await;
597 + } else {
598 + if let Some(name) = name {
599 + self.dispatch_event(CoreBluetoothEvent::DeviceUpdated {
600 + uuid,
601 + name: name.to_string(),
602 + })
603 + .await;
604 + }
605 + }
|
Check warning on line 355 in src/corebluetooth/internal.rs
github-actions / clippy macOS-latest
explicit call to `.into_iter()` in function argument accepting `IntoIterator`
warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator`
--> src/corebluetooth/internal.rs:355:32
|
355 | .chain(unsubscribe_future_state.into_iter());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `unsubscribe_future_state`
|
note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()`
--> /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf/library/core/src/iter/traits/iterator.rs:479:12
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
Check warning on line 355 in src/corebluetooth/internal.rs
github-actions / clippy macOS-latest
this `.into_iter()` call is equivalent to `.iter()` and will not consume the `VecDeque`
warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `VecDeque`
--> src/corebluetooth/internal.rs:355:57
|
355 | .chain(unsubscribe_future_state.into_iter());
| ^^^^^^^^^ help: call directly: `iter`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref
Check warning on line 354 in src/corebluetooth/internal.rs
github-actions / clippy macOS-latest
explicit call to `.into_iter()` in function argument accepting `IntoIterator`
warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator`
--> src/corebluetooth/internal.rs:354:32
|
354 | .chain(subscribe_future_state.into_iter())
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `subscribe_future_state`
|
note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()`
--> /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf/library/core/src/iter/traits/iterator.rs:479:12
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
Check warning on line 354 in src/corebluetooth/internal.rs
github-actions / clippy macOS-latest
this `.into_iter()` call is equivalent to `.iter()` and will not consume the `VecDeque`
warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `VecDeque`
--> src/corebluetooth/internal.rs:354:55
|
354 | .chain(subscribe_future_state.into_iter())
| ^^^^^^^^^ help: call directly: `iter`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref
Check warning on line 353 in src/corebluetooth/internal.rs
github-actions / clippy macOS-latest
explicit call to `.into_iter()` in function argument accepting `IntoIterator`
warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator`
--> src/corebluetooth/internal.rs:353:32
|
353 | .chain(write_future_state.into_iter())
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `write_future_state`
|
note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()`
--> /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf/library/core/src/iter/traits/iterator.rs:479:12
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
= note: `#[warn(clippy::useless_conversion)]` on by default
Check warning on line 353 in src/corebluetooth/internal.rs
github-actions / clippy macOS-latest
this `.into_iter()` call is equivalent to `.iter()` and will not consume the `VecDeque`
warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `VecDeque`
--> src/corebluetooth/internal.rs:353:51
|
353 | .chain(write_future_state.into_iter())
| ^^^^^^^^^ help: call directly: `iter`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref
Check warning on line 352 in src/corebluetooth/internal.rs
github-actions / clippy macOS-latest
this `.into_iter()` call is equivalent to `.iter()` and will not consume the `VecDeque`
warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `VecDeque`
--> src/corebluetooth/internal.rs:352:26
|
352 | .into_iter()
| ^^^^^^^^^ help: call directly: `iter`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref
= note: `#[warn(clippy::into_iter_on_ref)]` on by default
Check warning on line 230 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:225:17
|
225 | / if !map.contains_key(&characteristic_uuid) {
226 | | map.insert(
227 | | characteristic_uuid,
228 | | CharacteristicInternal::new(characteristic),
229 | | );
230 | | }
| |_________________^ help: try: `map.entry(characteristic_uuid).or_insert_with(|| CharacteristicInternal::new(characteristic));`
|
= 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
Check warning on line 92 in src/corebluetooth/internal.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/internal.rs:92:61
|
92 | let properties = CharacteristicInternal::form_flags(&*characteristic);
| ^^^^^^^^^^^^^^^^ help: try: `&characteristic`
|
= 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 39 in src/corebluetooth/future.rs
github-actions / clippy macOS-latest
doc list item without indentation
warning: doc list item without indentation
--> src/corebluetooth/future.rs:39:9
|
39 | /// corresponding future.
| ^
|
= help: if this is supposed to be its own paragraph, add a blank line
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
= note: `#[warn(clippy::doc_lazy_continuation)]` on by default
help: indent this line
|
39 | /// corresponding future.
| ++
Check warning on line 694 in src/corebluetooth/central_delegate.rs
github-actions / clippy macOS-latest
this expression creates a reference which is immediately dereferenced by the compiler
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/corebluetooth/central_delegate.rs:694:48
|
694 | data: get_descriptor_value(&descriptor),
| ^^^^^^^^^^^ help: change this to: `descriptor`
|
= 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 171 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:171:16
|
171 | 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