Skip to content

Commit

Permalink
clippy fixes (#1880)
Browse files Browse the repository at this point in the history
  • Loading branch information
svyatonik authored Feb 14, 2023
1 parent 29e8a30 commit 5457f06
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
8 changes: 4 additions & 4 deletions relays/messages/src/message_race_delivery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<P>(latest_generated_nonce);
metrics_msg.update_source_latest_confirmed_nonce::<P>(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 {
Expand Down Expand Up @@ -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::<P>(latest_received_nonce);
metrics_msg.update_target_latest_confirmed_nonce::<P>(latest_confirmed_nonce);
metrics_msg.update_target_latest_received_nonce(latest_received_nonce);
metrics_msg.update_target_latest_confirmed_nonce(latest_confirmed_nonce);
}
}

Expand Down
4 changes: 2 additions & 2 deletions relays/messages/src/message_race_receiving.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ where
) -> Result<(TargetHeaderIdOf<P>, SourceClientNonces<Self::NoncesRange>), 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::<P>(latest_received_nonce);
metrics_msg.update_target_latest_received_nonce(latest_received_nonce);
}
Ok((
at_block,
Expand Down Expand Up @@ -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::<P>(latest_confirmed_nonce);
metrics_msg.update_source_latest_confirmed_nonce(latest_confirmed_nonce);
}
}
Ok((at_block, TargetClientNonces { latest_nonce: latest_confirmed_nonce, nonces_data: () }))
Expand Down
11 changes: 4 additions & 7 deletions relays/messages/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ impl MessageLaneLoopMetrics {
}

/// Update latest generated nonce at source.
pub fn update_source_latest_generated_nonce<P: MessageLane>(
pub fn update_source_latest_generated_nonce(
&self,
source_latest_generated_nonce: MessageNonce,
) {
Expand All @@ -111,7 +111,7 @@ impl MessageLaneLoopMetrics {
}

/// Update the latest confirmed nonce at source.
pub fn update_source_latest_confirmed_nonce<P: MessageLane>(
pub fn update_source_latest_confirmed_nonce(
&self,
source_latest_confirmed_nonce: MessageNonce,
) {
Expand All @@ -121,17 +121,14 @@ impl MessageLaneLoopMetrics {
}

/// Update the latest received nonce at target.
pub fn update_target_latest_received_nonce<P: MessageLane>(
&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<P: MessageLane>(
pub fn update_target_latest_confirmed_nonce(
&self,
target_latest_confirmed_nonce: MessageNonce,
) {
Expand Down

0 comments on commit 5457f06

Please sign in to comment.