Skip to content

Commit

Permalink
remove dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
fafhrd91 committed Aug 12, 2021
1 parent 793237e commit 9862460
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 52 deletions.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![deny(rust_2018_idioms, unreachable_pub)]
#![deny(rust_2018_idioms)]
#![allow(clippy::type_complexity)]

#[macro_use]
Expand Down
51 changes: 0 additions & 51 deletions src/router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,57 +289,6 @@ impl<S> Future for RouterServiceResponse<S> {
}
}

struct HandleMessage {
link: ReceiverLink,
delivery_id: DeliveryNumber,
fut: Pin<Box<dyn Future<Output = Result<Outcome, Error>>>>,
}

impl Future for HandleMessage {
type Output = ();

fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
let mut this = self.as_mut();

match Pin::new(&mut this.fut).poll(cx) {
Poll::Pending => Poll::Pending,
Poll::Ready(Ok(outcome)) => {
log::trace!(
"Outcome is ready {:?} for {}",
outcome,
this.link
.frame()
.target
.as_ref()
.map_or("", |t| t.address.as_ref().map_or("", AsRef::as_ref))
);
let delivery_id = this.delivery_id;
settle(&mut this.link, delivery_id, outcome.into_delivery_state());
Poll::Ready(())
}
Poll::Ready(Err(e)) => {
log::trace!(
"Outcome is failed {:?} for {}",
e,
this.link
.frame()
.target
.as_ref()
.map_or("", |t| t.address.as_ref().map_or("", AsRef::as_ref))
);

let delivery_id = this.delivery_id;
settle(
&mut this.link,
delivery_id,
DeliveryState::Rejected(Rejected { error: Some(e) }),
);
Poll::Ready(())
}
}
}
}

fn settle(link: &mut ReceiverLink, id: DeliveryNumber, state: DeliveryState) {
let disposition = Disposition {
state: Some(state),
Expand Down

0 comments on commit 9862460

Please sign in to comment.