fix: Remove unneeded Option from the reading mock

pull/24376/head
Carol (Nichols || Goulding) 2021-07-01 14:52:23 -04:00
parent 854c28c41a
commit c53ae41d57
1 changed files with 3 additions and 3 deletions

View File

@ -226,7 +226,7 @@ pub mod test_helpers {
}
}
type MoveableEntries = Arc<Mutex<Option<Vec<Result<Entry, WriteBufferError>>>>>;
type MoveableEntries = Arc<Mutex<Vec<Result<Entry, WriteBufferError>>>>;
pub struct MockBufferForReading {
entries: MoveableEntries,
}
@ -240,7 +240,7 @@ pub mod test_helpers {
impl MockBufferForReading {
pub fn new(entries: Vec<Result<Entry, WriteBufferError>>) -> 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())