Skip to content

Commit a1b684f

Browse files
nits
1 parent ed497e8 commit a1b684f

5 files changed

Lines changed: 3 additions & 13 deletions

File tree

consensus/src/marshal/coding/marshaled.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,6 @@ where
569569
let parent_fetch_duration = proposal_parent_fetch_duration.start(&runtime_context);
570570
let parent = select! {
571571
_ = tx.closed() => {
572-
parent_fetch_duration.discard();
573572
debug!(reason = "consensus dropped receiver", "skipping proposal");
574573
return;
575574
},
@@ -623,7 +622,6 @@ where
623622
let build_duration = build_duration.start(&runtime_context);
624623
let built_block = select! {
625624
_ = tx.closed() => {
626-
build_duration.discard();
627625
debug!(reason = "consensus dropped receiver", "skipping proposal");
628626
return;
629627
},

consensus/src/marshal/standard/deferred.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,6 @@ where
395395
let build_duration = build_duration.start(&runtime_context);
396396
let built_block = select! {
397397
_ = tx.closed() => {
398-
build_duration.discard();
399398
debug!(reason = "consensus dropped receiver", "skipping proposal");
400399
return;
401400
},

consensus/src/marshal/standard/inline.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,6 @@ where
324324
let build_duration = build_duration.start(&runtime_context);
325325
let built_block = select! {
326326
_ = tx.closed() => {
327-
build_duration.discard();
328327
debug!(reason = "consensus dropped receiver", "skipping proposal");
329328
return;
330329
},

resolver/src/p2p/engine.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ impl<
259259
let mut guard = self.metrics.cancel.guard(Status::Dropped);
260260
if self.fetcher.cancel(&key) {
261261
guard.set(Status::Success);
262-
self.fetch_timers.remove(&key).unwrap().discard(); // must exist
262+
let _ = self.fetch_timers.remove(&key).expect("must exist");
263263
self.consumer.failed(key.clone(), ()).await;
264264
}
265265
}

runtime/src/telemetry/metrics/histogram.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,8 @@ pub struct Timed {
9191
/// A sampled histogram observation.
9292
///
9393
/// This token is explicit: dropping it records nothing. Call [`Started::observe_now`] or
94-
/// [`Started::observe_at`] to record a duration, or [`Started::discard`] when the timing should
95-
/// be ignored (for example on a fast-path cancellation).
96-
#[must_use = "call observe_now/observe_at to record the timing, or discard it explicitly"]
94+
/// [`Started::observe_at`] to record a duration.
95+
#[must_use = "call observe_now/observe_at to record the timing, or drop it to skip recording"]
9796
pub struct Started {
9897
/// The histogram to record durations in.
9998
histogram: Histogram,
@@ -152,8 +151,6 @@ impl Timed {
152151
let result = f();
153152
if result.is_some() {
154153
started.observe_now(clock);
155-
} else {
156-
started.discard();
157154
}
158155
result
159156
}
@@ -174,7 +171,4 @@ impl Started {
174171
pub fn observe_at(self, end: SystemTime) {
175172
self.histogram.observe_between(self.start, end);
176173
}
177-
178-
/// Discard the observation without recording it.
179-
pub fn discard(self) {}
180174
}

0 commit comments

Comments
 (0)