Fix longstanding message_queue warning

This commit is contained in:
Lucien Greathouse
2020-12-14 10:12:51 -08:00
parent 23b8308282
commit 98238e4516

View File

@@ -1,7 +1,4 @@
use std::{ use std::sync::{Mutex, RwLock};
mem,
sync::{Mutex, RwLock},
};
use futures::sync::oneshot; use futures::sync::oneshot;
@@ -58,7 +55,7 @@ impl<T: Clone> MessageQueue<T> {
// Without this annotation, Rust gets confused since the first argument // Without this annotation, Rust gets confused since the first argument
// is a MutexGuard, but the second is a Vec. // is a MutexGuard, but the second is a Vec.
mem::replace::<Vec<_>>(&mut message_listeners, remaining_listeners); *message_listeners = remaining_listeners;
} }
/// Subscribe to any messages occurring after the given message cursor. /// Subscribe to any messages occurring after the given message cursor.