mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-18 12:06:43 +00:00
Add #[must_use]
to all guard types
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
9e4775d9e2
commit
57ecfa2fec
@ -196,6 +196,8 @@ impl PreemptInfo {
|
||||
}
|
||||
|
||||
/// A guard for disable preempt.
|
||||
#[clippy::has_significant_drop]
|
||||
#[must_use]
|
||||
pub struct DisablePreemptGuard {
|
||||
// This private field prevents user from constructing values of this type directly.
|
||||
private: (),
|
||||
@ -223,7 +225,6 @@ impl Drop for DisablePreemptGuard {
|
||||
}
|
||||
|
||||
/// Disables preemption.
|
||||
#[must_use]
|
||||
pub fn disable_preempt() -> DisablePreemptGuard {
|
||||
DisablePreemptGuard::new()
|
||||
}
|
||||
|
Reference in New Issue
Block a user