Remove retain_mut crate (#11926)

* Remove retain_mut crate

* Remove reain_mut crate from babe-consensus
This commit is contained in:
Sebastian Kunert
2022-07-28 00:35:33 +02:00
committed by GitHub
parent 72522429a7
commit c831138c0a
5 changed files with 24 additions and 38 deletions
+10 -12
View File
@@ -87,7 +87,6 @@ use futures::{
use log::{debug, info, log, trace, warn};
use parking_lot::Mutex;
use prometheus_endpoint::Registry;
use retain_mut::RetainMut;
use schnorrkel::SignatureError;
use sc_client_api::{
@@ -835,17 +834,16 @@ where
slot: Slot,
epoch_descriptor: &ViableEpochDescriptor<B::Hash, NumberFor<B>, Epoch>,
) {
RetainMut::retain_mut(&mut *self.slot_notification_sinks.lock(), |sink| {
match sink.try_send((slot, epoch_descriptor.clone())) {
Ok(()) => true,
Err(e) =>
if e.is_full() {
warn!(target: "babe", "Trying to notify a slot but the channel is full");
true
} else {
false
},
}
let sinks = &mut self.slot_notification_sinks.lock();
sinks.retain_mut(|sink| match sink.try_send((slot, epoch_descriptor.clone())) {
Ok(()) => true,
Err(e) =>
if e.is_full() {
warn!(target: "babe", "Trying to notify a slot but the channel is full");
true
} else {
false
},
});
}