clippy fixes (#9173)

This commit is contained in:
Squirrel
2021-07-26 14:12:18 +01:00
committed by GitHub
parent 17c6477683
commit ec047abbcf
5 changed files with 29 additions and 34 deletions
+3 -5
View File
@@ -101,7 +101,7 @@ mod inner {
/// Proxy function to mpsc::UnboundedSender
pub fn unbounded_send(&self, msg: T) -> Result<(), TrySendError<T>> {
self.1.unbounded_send(msg).map(|s| {
UNBOUNDED_CHANNELS_COUNTER.with_label_values(&[self.0, &"send"]).inc();
UNBOUNDED_CHANNELS_COUNTER.with_label_values(&[self.0, "send"]).inc();
s
})
}
@@ -128,9 +128,7 @@ mod inner {
}
// and discount the messages
if count > 0 {
UNBOUNDED_CHANNELS_COUNTER
.with_label_values(&[self.0, &"dropped"])
.inc_by(count);
UNBOUNDED_CHANNELS_COUNTER.with_label_values(&[self.0, "dropped"]).inc_by(count);
}
}
@@ -146,7 +144,7 @@ mod inner {
pub fn try_next(&mut self) -> Result<Option<T>, TryRecvError> {
self.1.try_next().map(|s| {
if s.is_some() {
UNBOUNDED_CHANNELS_COUNTER.with_label_values(&[self.0, &"received"]).inc();
UNBOUNDED_CHANNELS_COUNTER.with_label_values(&[self.0, "received"]).inc();
}
s
})