mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-24 01:43:22 +00:00
Fix multiple Default
implementation caveats
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
8633893bb9
commit
d6714c4b47
@ -236,6 +236,7 @@ impl UserPreemption {
|
||||
const PREEMPTION_INTERVAL: u32 = 100;
|
||||
|
||||
/// Creates a new instance of `UserPreemption`.
|
||||
#[allow(clippy::new_without_default)]
|
||||
pub const fn new() -> Self {
|
||||
UserPreemption { count: 0 }
|
||||
}
|
||||
|
@ -146,6 +146,12 @@ impl WaitQueue {
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for WaitQueue {
|
||||
fn default() -> Self {
|
||||
Self::new()
|
||||
}
|
||||
}
|
||||
|
||||
/// A waiter that can put the current thread to sleep until it is woken up by the associated
|
||||
/// [`Waker`].
|
||||
///
|
||||
|
Reference in New Issue
Block a user