Skip to content

doc: Update release date for 0.11.1 #349

doc: Update release date for 0.11.1

doc: Update release date for 0.11.1 #349

GitHub Actions / clippy macOS-latest succeeded Sep 8, 2023 in 0s

clippy macOS-latest

17 warnings

Details

Results

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

Versions

  • rustc 1.72.0 (5680fa18f 2023-08-23)
  • cargo 1.72.0 (103a7ff2e 2023-08-15)
  • clippy 0.1.72 (5680fa18 2023-08-23)

Annotations

Check warning on line 291 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: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

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: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 this
    |
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

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: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

See this annotation in the file changed.

@github-actions 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:13
    |
382 |             nsstring_to_string(nsstring).unwrap_or_else(|| "".to_string())
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `nsstring_to_string(nsstring).unwrap_or_default()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_else_default
    = note: `#[warn(clippy::unwrap_or_else_default)]` on by default

Check warning on line 314 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: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

Check warning on line 19 in src/common/util.rs

See this annotation in the file changed.

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

called `unwrap` on `x` after checking its variant with `is_ok`

warning: called `unwrap` on `x` after checking its variant with `is_ok`
  --> src/common/util.rs:19:18
   |
18 |         if x.is_ok() {
   |         ------------ help: try: `if let Ok(..) = x`
19 |             Some(x.unwrap())
   |                  ^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap

Check warning on line 63 in src/common/adapter_manager.rs

See this annotation in the file changed.

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

called `unwrap` on `x` after checking its variant with `is_ok`

warning: called `unwrap` on `x` after checking its variant with `is_ok`
  --> src/common/adapter_manager.rs:63:22
   |
62 |             if x.is_ok() {
   |             ------------ help: try: `if let Ok(..) = x`
63 |                 Some(x.unwrap())
   |                      ^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap
   = note: `#[warn(clippy::unnecessary_unwrap)]` on by default

Check warning on line 52 in src/common/adapter_manager.rs

See this annotation in the file changed.

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

you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`

warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
  --> src/common/adapter_manager.rs:47:9
   |
47 | /         match event {
48 | |             CentralEvent::DeviceDisconnected(ref id) => {
49 | |                 self.peripherals.remove(id);
50 | |             }
51 | |             _ => {}
52 | |         }
   | |_________^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
   = note: `#[warn(clippy::single_match)]` on by default
help: try this
   |
47 ~         if let CentralEvent::DeviceDisconnected(ref id) = event {
48 +             self.peripherals.remove(id);
49 +         }
   |

Check warning on line 70 in src/api/mod.rs

See this annotation in the file changed.

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

method `from_str` can be confused for the standard trait method `std::str::FromStr::from_str`

warning: method `from_str` can be confused for the standard trait method `std::str::FromStr::from_str`
  --> src/api/mod.rs:64:5
   |
64 | /     pub fn from_str(v: &str) -> Option<AddressType> {
65 | |         match v {
66 | |             "public" => Some(AddressType::Public),
67 | |             "random" => Some(AddressType::Random),
68 | |             _ => None,
69 | |         }
70 | |     }
   | |_____^
   |
   = help: consider implementing the trait `std::str::FromStr` or choosing a less ambiguous method name
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait
   = note: `#[warn(clippy::should_implement_trait)]` on by default

Check warning on line 61 in src/api/mod.rs

See this annotation in the file changed.

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

this `impl` can be derived

warning: this `impl` can be derived
  --> src/api/mod.rs:57:1
   |
57 | / impl Default for AddressType {
58 | |     fn default() -> Self {
59 | |         AddressType::Public
60 | |     }
61 | | }
   | |_^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls
   = note: `#[warn(clippy::derivable_impls)]` on by default
   = help: remove the manual implementation...
help: ...and instead derive it...
   |
52 + #[derive(Default)]
53 | pub enum AddressType {
   |
help: ...and mark the default variant
   |
54 ~     #[default]
55 ~     Public,
   |

Check warning on line 109 in src/api/bdaddr.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/api/bdaddr.rs:109:9
    |
109 |         (&mut slice[2..]).copy_from_slice(&addr.into_inner());
    |         ^^^^^^^^^^^^^^^^^ help: change this to: `slice[2..]`
    |
    = 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

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:296:15
    |
296 |     pub const PERIPHERALSTATE_CONNECTED: c_int = 2; // CBPeripheralStateConnected
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^

Check warning on line 204 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: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

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: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

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: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

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

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

See this annotation in the file changed.

@github-actions 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