Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- OTA: Allow specifying image size to speed up erase
- Bluetooth: New methods `EspBleGap::start_scanning` and `EspBleGap::stop_scanning`
- New example, `bt_ble_gap_scanner` to demonstrate usage of added ble scanning methods
- Add #[must_use] annotations to event loop types with drop handlers.

## [0.51.0] - 2025-01-15

Expand Down
2 changes: 2 additions & 0 deletions src/eventloop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ where
}
}

#[must_use = "Event subscription is unregistered when handle is dropped"]
pub struct EspSubscription<'a, T>
where
T: EspEventLoopType,
Expand Down Expand Up @@ -486,6 +487,7 @@ where
}
}

#[must_use = "Event loop is deleted when handle is dropped"]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder why you need that one given that it is an internal type? Just for the esp-idf-svc code itself, or am I missing something?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was just about to open the PR with the EspSubscription annoation and I thought "I'll quickly check if there's any other Drop impls" and so stuck one on this - didn't even notice it wasn't pub.

I've pushed 717c0fb to remove this one 👍

#[derive(Debug)]
struct EventLoopHandle<T>(T)
where
Expand Down