Deserializing BDAddr from non-borrowed string without clone (#415) #452
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.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 601 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:582:9
|
582 | / if self.peripherals.contains_key(&uuid) {
583 | | if let Some(name) = name {
584 | | self.dispatch_event(CoreBluetoothEvent::DeviceUpdated {
585 | | uuid,
... |
600 | | .await;
601 | | }
| |_________^
|
= 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
|
582 ~ if let std::collections::hash_map::Entry::Vacant(e) = self.peripherals.entry(uuid) {
583 + // Create our channels
584 + let (event_sender, event_receiver) = mpsc::channel(256);
585 + e.insert(PeripheralInternal::new(peripheral, event_sender));
586 + self.dispatch_event(CoreBluetoothEvent::DeviceDiscovered {
587 + uuid,
588 + name: name.map(|name| name.to_string()),
589 + event_receiver,
590 + })
591 + .await;
592 + } else {
593 + if let Some(name) = name {
594 + self.dispatch_event(CoreBluetoothEvent::DeviceUpdated {
595 + uuid,
596 + name: name.to_string(),
597 + })
598 + .await;
599 + }
600 + }
|
Check warning on line 350 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:350:32
|
350 | .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 350 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:350:57
|
350 | .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 349 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:349:32
|
349 | .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 349 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:349:55
|
349 | .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 348 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:348:32
|
348 | .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 348 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:348:51
|
348 | .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 347 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:347:26
|
347 | .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 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