From dfb4e55df035d5d3c1c998de723f29b987f6507e Mon Sep 17 00:00:00 2001 From: Svyatoslav Nikolsky Date: Tue, 14 Feb 2023 10:39:02 +0300 Subject: [PATCH] clippy fixes (#1880) --- bridges/relays/messages/src/message_race_delivery.rs | 8 ++++---- bridges/relays/messages/src/message_race_receiving.rs | 4 ++-- bridges/relays/messages/src/metrics.rs | 11 ++++------- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/bridges/relays/messages/src/message_race_delivery.rs b/bridges/relays/messages/src/message_race_delivery.rs index 0d957fd8b716..c704a7b56107 100644 --- a/bridges/relays/messages/src/message_race_delivery.rs +++ b/bridges/relays/messages/src/message_race_delivery.rs @@ -124,8 +124,8 @@ where self.client.latest_confirmed_received_nonce(at_block).await?; if let Some(metrics_msg) = self.metrics_msg.as_ref() { - metrics_msg.update_source_latest_generated_nonce::

(latest_generated_nonce); - metrics_msg.update_source_latest_confirmed_nonce::

(latest_confirmed_nonce); + metrics_msg.update_source_latest_generated_nonce(latest_generated_nonce); + metrics_msg.update_source_latest_confirmed_nonce(latest_confirmed_nonce); } let new_nonces = if latest_generated_nonce > prev_latest_nonce { @@ -195,8 +195,8 @@ where if update_metrics { if let Some(metrics_msg) = self.metrics_msg.as_ref() { - metrics_msg.update_target_latest_received_nonce::

(latest_received_nonce); - metrics_msg.update_target_latest_confirmed_nonce::

(latest_confirmed_nonce); + metrics_msg.update_target_latest_received_nonce(latest_received_nonce); + metrics_msg.update_target_latest_confirmed_nonce(latest_confirmed_nonce); } } diff --git a/bridges/relays/messages/src/message_race_receiving.rs b/bridges/relays/messages/src/message_race_receiving.rs index 70a3d7c24772..e6497a1b79eb 100644 --- a/bridges/relays/messages/src/message_race_receiving.rs +++ b/bridges/relays/messages/src/message_race_receiving.rs @@ -112,7 +112,7 @@ where ) -> Result<(TargetHeaderIdOf

, SourceClientNonces), Self::Error> { let (at_block, latest_received_nonce) = self.client.latest_received_nonce(at_block).await?; if let Some(metrics_msg) = self.metrics_msg.as_ref() { - metrics_msg.update_target_latest_received_nonce::

(latest_received_nonce); + metrics_msg.update_target_latest_received_nonce(latest_received_nonce); } Ok(( at_block, @@ -174,7 +174,7 @@ where self.client.latest_confirmed_received_nonce(at_block).await?; if update_metrics { if let Some(metrics_msg) = self.metrics_msg.as_ref() { - metrics_msg.update_source_latest_confirmed_nonce::

(latest_confirmed_nonce); + metrics_msg.update_source_latest_confirmed_nonce(latest_confirmed_nonce); } } Ok((at_block, TargetClientNonces { latest_nonce: latest_confirmed_nonce, nonces_data: () })) diff --git a/bridges/relays/messages/src/metrics.rs b/bridges/relays/messages/src/metrics.rs index 20c6986b4747..69d80d178de8 100644 --- a/bridges/relays/messages/src/metrics.rs +++ b/bridges/relays/messages/src/metrics.rs @@ -101,7 +101,7 @@ impl MessageLaneLoopMetrics { } /// Update latest generated nonce at source. - pub fn update_source_latest_generated_nonce( + pub fn update_source_latest_generated_nonce( &self, source_latest_generated_nonce: MessageNonce, ) { @@ -111,7 +111,7 @@ impl MessageLaneLoopMetrics { } /// Update the latest confirmed nonce at source. - pub fn update_source_latest_confirmed_nonce( + pub fn update_source_latest_confirmed_nonce( &self, source_latest_confirmed_nonce: MessageNonce, ) { @@ -121,17 +121,14 @@ impl MessageLaneLoopMetrics { } /// Update the latest received nonce at target. - pub fn update_target_latest_received_nonce( - &self, - target_latest_generated_nonce: MessageNonce, - ) { + pub fn update_target_latest_received_nonce(&self, target_latest_generated_nonce: MessageNonce) { self.lane_state_nonces .with_label_values(&["target_latest_received"]) .set(target_latest_generated_nonce); } /// Update the latest confirmed nonce at target. - pub fn update_target_latest_confirmed_nonce( + pub fn update_target_latest_confirmed_nonce( &self, target_latest_confirmed_nonce: MessageNonce, ) {