diff --git a/server/src/write_buffer.rs b/server/src/write_buffer.rs index 9d68cb4f00..1cc90ae8a3 100644 --- a/server/src/write_buffer.rs +++ b/server/src/write_buffer.rs @@ -226,7 +226,7 @@ pub mod test_helpers { } } - type MoveableEntries = Arc>>>>; + type MoveableEntries = Arc>>>; pub struct MockBufferForReading { entries: MoveableEntries, } @@ -240,7 +240,7 @@ pub mod test_helpers { impl MockBufferForReading { pub fn new(entries: Vec>) -> Self { Self { - entries: Arc::new(Mutex::new(Some(entries))), + entries: Arc::new(Mutex::new(entries)), } } } @@ -254,7 +254,7 @@ pub mod test_helpers { Self: 'async_trait, { // move the entries out of `self` to move them into the stream - let entries = self.entries.lock().unwrap().take().unwrap(); + let entries: Vec<_> = self.entries.lock().unwrap().drain(..).collect(); stream::iter(entries.into_iter()) .chain(stream::pending())