Skip to content

Commit 0b7533e

Browse files
committed
Appease clippy
1 parent 99586de commit 0b7533e

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

common/explorer_api/src/lib.rs

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,9 @@ impl ExplorerHttpClient {
144144

145145
/// Gets beacon metrics and updates the metrics struct
146146
pub async fn get_beacon_metrics(&self) -> Result<ExplorerMetrics, Error> {
147-
let path = self
148-
.beacon_endpoint
149-
.clone()
150-
.ok_or(Error::BeaconMetricsFailed(
151-
"Beacon metrics endpoint not provided".to_string(),
152-
))?;
147+
let path = self.beacon_endpoint.clone().ok_or_else(|| {
148+
Error::BeaconMetricsFailed("Beacon metrics endpoint not provided".to_string())
149+
})?;
153150
let resp: BeaconProcessMetrics = self.get(path).await?;
154151
Ok(ExplorerMetrics {
155152
metadata: Metadata::new(ProcessType::Beacon),
@@ -159,12 +156,9 @@ impl ExplorerHttpClient {
159156

160157
/// Gets validator process metrics by querying the validator metrics endpoint
161158
pub async fn get_validator_metrics(&self) -> Result<ExplorerMetrics, Error> {
162-
let path = self
163-
.validator_endpoint
164-
.clone()
165-
.ok_or(Error::ValidatorMetricsFailed(
166-
"Validator metrics endpoint not provided".to_string(),
167-
))?;
159+
let path = self.validator_endpoint.clone().ok_or_else(|| {
160+
Error::ValidatorMetricsFailed("Validator metrics endpoint not provided".to_string())
161+
})?;
168162
let resp: ValidatorProcessMetrics = self.get(path).await?;
169163
Ok(ExplorerMetrics {
170164
metadata: Metadata::new(ProcessType::Beacon),

0 commit comments

Comments
 (0)