impl Default

This commit is contained in:
rise0chen 2021-07-28 15:09:57 +08:00
parent e7c4c7b1f2
commit 3264c92292
3 changed files with 18 additions and 0 deletions

View File

@ -241,6 +241,12 @@ where
}
}
impl<T, const N: usize> Default for HistoryBuffer<T, N> {
fn default() -> Self {
Self::new()
}
}
#[cfg(test)]
mod tests {
use crate::HistoryBuffer;

View File

@ -178,6 +178,12 @@ impl<T, const N: usize> MpMcQueue<T, N> {
}
}
impl<T, const N: usize> Default for MpMcQueue<T, N> {
fn default() -> Self {
Self::new()
}
}
unsafe impl<T, const N: usize> Sync for MpMcQueue<T, N> where T: Send {}
struct Cell<T> {

View File

@ -297,6 +297,12 @@ impl<T, const N: usize> Queue<T, N> {
}
}
impl<T, const N: usize> Default for Queue<T, N> {
fn default() -> Self {
Self::new()
}
}
impl<T, const N: usize> Clone for Queue<T, N>
where
T: Clone,