Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clippy fixes #1880

Merged
merged 1 commit into from
Feb 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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