Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Changes from 1 commit
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
Next Next commit
fix/warn: name is unused, only in debug would be used and but nobody …
…does
  • Loading branch information
drahnr committed Nov 4, 2021
commit cf3e659b9706e0b53ef5bdeb6770f2d9e4d8037c
5 changes: 2 additions & 3 deletions node/metered-channel/src/oneshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ pub fn channel<T>(
let (tx, rx) = oneshot::channel();

(
MeteredSender { name, inner: tx },
MeteredSender { inner: tx },
MeteredReceiver {
name,
inner: rx,
Expand Down Expand Up @@ -113,14 +113,13 @@ impl Measurable for Error {
/// Oneshot sender, created by [`channel`].
#[derive(Debug)]
pub struct MeteredSender<T> {
name: &'static str,
inner: oneshot::Sender<(Instant, T)>,
}

impl<T> MeteredSender<T> {
/// Send a value.
pub fn send(self, t: T) -> Result<(), T> {
let Self { inner, name: _ } = self;
let Self { inner } = self;
inner.send((Instant::now(), t)).map_err(|(_, t)| t)
}

Expand Down