Add must_use

This commit is contained in:
SoniEx2 2018-11-03 20:20:53 -03:00
parent 04a76896ff
commit c9bc69de71
2 changed files with 5 additions and 1 deletions

View File

@ -1,6 +1,6 @@
[package] [package]
name = "hexchat-plugin" name = "hexchat-plugin"
version = "0.2.9" version = "0.2.10"
authors = ["SoniEx2 <endermoneymod@gmail.com>"] authors = ["SoniEx2 <endermoneymod@gmail.com>"]
description = "Lets you write HexChat plugins in Rust" description = "Lets you write HexChat plugins in Rust"
license = "AGPL-3.0+" license = "AGPL-3.0+"

View File

@ -314,6 +314,7 @@ pub struct Eat {
} }
/// A command hook handle. /// A command hook handle.
#[must_use = "Hooks must be stored somewhere and are automatically unhooked on Drop"]
pub struct CommandHookHandle { pub struct CommandHookHandle {
ph: *mut internals::Ph, ph: *mut internals::Ph,
hh: *const internals::HexchatHook, hh: *const internals::HexchatHook,
@ -322,6 +323,7 @@ pub struct CommandHookHandle {
} }
/// A server hook handle. /// A server hook handle.
#[must_use = "Hooks must be stored somewhere and are automatically unhooked on Drop"]
pub struct ServerHookHandle { pub struct ServerHookHandle {
ph: *mut internals::Ph, ph: *mut internals::Ph,
hh: *const internals::HexchatHook, hh: *const internals::HexchatHook,
@ -330,6 +332,7 @@ pub struct ServerHookHandle {
} }
/// A print hook handle. /// A print hook handle.
#[must_use = "Hooks must be stored somewhere and are automatically unhooked on Drop"]
pub struct PrintHookHandle { pub struct PrintHookHandle {
ph: *mut internals::Ph, ph: *mut internals::Ph,
hh: *const internals::HexchatHook, hh: *const internals::HexchatHook,
@ -338,6 +341,7 @@ pub struct PrintHookHandle {
} }
/// A timer hook handle. /// A timer hook handle.
#[must_use = "Hooks must be stored somewhere and are automatically unhooked on Drop"]
pub struct TimerHookHandle { pub struct TimerHookHandle {
ph: *mut internals::Ph, ph: *mut internals::Ph,
hh: *const internals::HexchatHook, hh: *const internals::HexchatHook,