Skip to content

Commit

Permalink
Add #[must_use] to handle types.
Browse files Browse the repository at this point in the history
  • Loading branch information
surban committed Jun 26, 2024
1 parent b2318c6 commit 9c01bef
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 1 deletion.
1 change: 0 additions & 1 deletion bluer/src/adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ use std::{
collections::{BTreeSet, HashMap, HashSet},
fmt::{Debug, Formatter},
sync::Arc,
u32,
};
use strum::{Display, EnumString};
use tokio::sync::mpsc;
Expand Down
1 change: 1 addition & 0 deletions bluer/src/adv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ impl Advertisement {
/// Handle to active Bluetooth LE advertisement.
///
/// Drop to unregister advertisement.
#[must_use = "AdvertisementHandle must be held for advertisement to be broadcasted"]
pub struct AdvertisementHandle {
name: dbus::Path<'static>,
_drop_tx: oneshot::Sender<()>,
Expand Down
1 change: 1 addition & 0 deletions bluer/src/agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,7 @@ impl RegisteredAgent {
/// Handle to registered agent.
///
/// Drop to unregister agent.
#[must_use = "AgentHandle must be held for agent to be registered"]
pub struct AgentHandle {
name: dbus::Path<'static>,
_drop_tx: oneshot::Sender<()>,
Expand Down
1 change: 1 addition & 0 deletions bluer/src/gatt/local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1463,6 +1463,7 @@ impl Profile {
/// Handle to published local profile (GATT client) instance.
///
/// Drop this handle to unpublish.
#[must_use = "ProfileHandle must be held for profile to be published"]
pub struct ProfileHandle {
name: dbus::Path<'static>,
_drop_tx: oneshot::Sender<()>,
Expand Down
1 change: 1 addition & 0 deletions bluer/src/mesh/application.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ pub(crate) struct ApplicationInner {
/// Handle to Bluetooth mesh application.
///
/// Drop this handle to unpublish.
#[must_use = "ApplicationHandle must be held for mesh application to be published"]
pub struct ApplicationHandle {
pub(crate) app_inner: Arc<ApplicationInner>,
pub(crate) name: dbus::Path<'static>,
Expand Down

0 comments on commit 9c01bef

Please sign in to comment.