Merge pull request #224 from rise0chen/master

impl Default
This commit is contained in:
Emil Fresk 2021-07-30 14:38:52 +02:00 committed by GitHub
commit 7f2a01f16b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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,