mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 07:01:05 +00:00
Remove retain_mut crate (#11926)
* Remove retain_mut crate * Remove reain_mut crate from babe-consensus
This commit is contained in:
@@ -26,7 +26,6 @@ num-rational = "0.2.2"
|
||||
num-traits = "0.2.8"
|
||||
parking_lot = "0.12.0"
|
||||
rand = "0.7.2"
|
||||
retain_mut = "0.1.4"
|
||||
schnorrkel = { version = "0.9.1", features = ["preaudit_deprecated"] }
|
||||
serde = { version = "1.0.136", features = ["derive"] }
|
||||
thiserror = "1.0"
|
||||
|
||||
@@ -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
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user