Fix cargo clippy warning in peerset. (#7641)

* Fix cargo clippy warning in peerset.

* Update client/peerset/src/lib.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
This commit is contained in:
jolestar
2020-12-01 18:58:00 +08:00
committed by GitHub
parent 762b4b25d0
commit 22a28db957
5 changed files with 33 additions and 35 deletions
+1 -1
View File
@@ -63,7 +63,7 @@ mod inner {
/// `UNBOUNDED_CHANNELS_COUNTER`
pub fn tracing_unbounded<T>(key: &'static str) ->(TracingUnboundedSender<T>, TracingUnboundedReceiver<T>) {
let (s, r) = mpsc::unbounded();
(TracingUnboundedSender(key.clone(), s), TracingUnboundedReceiver(key,r))
(TracingUnboundedSender(key, s), TracingUnboundedReceiver(key,r))
}
impl<T> TracingUnboundedSender<T> {
@@ -43,6 +43,12 @@ struct YieldAfter<T> {
sender: Option<TracingUnboundedSender<T>>,
}
impl <T> Default for StatusSinks<T> {
fn default() -> Self {
Self::new()
}
}
impl<T> StatusSinks<T> {
/// Builds a new empty collection.
pub fn new() -> StatusSinks<T> {