Apply some clippy lints (#11154)

* Apply some clippy hints

* Revert clippy ci changes

* Update client/cli/src/commands/generate.rs

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

* Update client/cli/src/commands/inspect_key.rs

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

* Update client/db/src/bench.rs

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

* Update client/db/src/bench.rs

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

* Update client/service/src/client/block_rules.rs

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

* Update client/service/src/client/block_rules.rs

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

* Update client/network/src/transactions.rs

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

* Update client/network/src/protocol.rs

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

* Revert due to missing `or_default` function.

* Fix compilation and simplify code

* Undo change that corrupts benchmark.

* fix clippy

* Update client/service/test/src/lib.rs

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

* Update client/state-db/src/noncanonical.rs

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

* Update client/state-db/src/noncanonical.rs

remove leftovers!

* Update client/tracing/src/logging/directives.rs

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

* Update utils/fork-tree/src/lib.rs

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

* added needed ref

* Update frame/referenda/src/benchmarking.rs

* Simplify byte-vec creation

* let's just not overlap the ranges

* Correction

* cargo fmt

* Update utils/frame/benchmarking-cli/src/shared/stats.rs

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

* Update utils/frame/benchmarking-cli/src/pallet/command.rs

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

* Update utils/frame/benchmarking-cli/src/pallet/command.rs

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

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: Giles Cope <gilescope@gmail.com>
This commit is contained in:
Falco Hirschenberger
2022-04-30 23:28:27 +02:00
committed by GitHub
parent a990473cf9
commit b581604aa7
368 changed files with 1927 additions and 2236 deletions
+4 -4
View File
@@ -246,7 +246,7 @@ impl TelemetryWorker {
"Initializing telemetry for: {:?}",
addr,
);
node_map.entry(id.clone()).or_default().push((verbosity, addr.clone()));
node_map.entry(id).or_default().push((verbosity, addr.clone()));
let node = node_pool.entry(addr.clone()).or_insert_with(|| {
Node::new(transport.clone(), addr.clone(), Vec::new(), Vec::new())
@@ -288,7 +288,7 @@ impl TelemetryWorker {
) {
let (id, verbosity, payload) = input.expect("the stream is never closed; qed");
let ts = chrono::Local::now().to_rfc3339().to_string();
let ts = chrono::Local::now().to_rfc3339();
let mut message = serde_json::Map::new();
message.insert("id".into(), id.into());
message.insert("ts".into(), ts.into());
@@ -318,7 +318,7 @@ impl TelemetryWorker {
continue
}
if let Some(node) = node_pool.get_mut(&addr) {
if let Some(node) = node_pool.get_mut(addr) {
let _ = node.send(message.clone()).await;
} else {
log::debug!(
@@ -386,7 +386,7 @@ impl Telemetry {
/// The `connection_message` argument is a JSON object that is sent every time the connection
/// (re-)establishes.
pub fn start_telemetry(&mut self, connection_message: ConnectionMessage) -> Result<()> {
let endpoints = self.endpoints.take().ok_or_else(|| Error::TelemetryAlreadyInitialized)?;
let endpoints = self.endpoints.take().ok_or(Error::TelemetryAlreadyInitialized)?;
self.register_sender
.unbounded_send(Register::Telemetry { id: self.id, endpoints, connection_message })
+1 -1
View File
@@ -239,7 +239,7 @@ where
},
},
NodeSocket::WaitingReconnect(mut s) => {
if let Poll::Ready(_) = Future::poll(Pin::new(&mut s), cx) {
if Future::poll(Pin::new(&mut s), cx).is_ready() {
socket = NodeSocket::ReconnectNow;
} else {
break NodeSocket::WaitingReconnect(s)