Skip to content

Commit 7f2a01f

Browse files
authored
Merge pull request #224 from rise0chen/master
impl Default
2 parents 312e903 + 3264c92 commit 7f2a01f

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

src/histbuf.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,12 @@ where
241241
}
242242
}
243243

244+
impl<T, const N: usize> Default for HistoryBuffer<T, N> {
245+
fn default() -> Self {
246+
Self::new()
247+
}
248+
}
249+
244250
#[cfg(test)]
245251
mod tests {
246252
use crate::HistoryBuffer;

src/mpmc.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,12 @@ impl<T, const N: usize> MpMcQueue<T, N> {
178178
}
179179
}
180180

181+
impl<T, const N: usize> Default for MpMcQueue<T, N> {
182+
fn default() -> Self {
183+
Self::new()
184+
}
185+
}
186+
181187
unsafe impl<T, const N: usize> Sync for MpMcQueue<T, N> where T: Send {}
182188

183189
struct Cell<T> {

src/spsc.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,12 @@ impl<T, const N: usize> Queue<T, N> {
297297
}
298298
}
299299

300+
impl<T, const N: usize> Default for Queue<T, N> {
301+
fn default() -> Self {
302+
Self::new()
303+
}
304+
}
305+
300306
impl<T, const N: usize> Clone for Queue<T, N>
301307
where
302308
T: Clone,

0 commit comments

Comments
 (0)