Skip to content

Commit

Permalink
fix: Use drop method to consume command success
Browse files Browse the repository at this point in the history
  • Loading branch information
CleverAkanoa committed Jan 3, 2023
1 parent be9c558 commit 30fae5c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/producer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,7 @@ impl<Exe: Executor> Producer<Exe> {
}
}

#[cfg_attr(feature = "telemetry", tracing::instrument(skip_all))]
pub async fn close(&mut self) -> Result<(), Error> {
match &mut self.inner {
ProducerInner::Single(producer) => producer.close().await,
Expand Down Expand Up @@ -1027,6 +1028,7 @@ impl<Exe: Executor> TopicProducer<Exe> {
Ok(())
}

#[cfg_attr(feature = "telemetry", tracing::instrument(skip_all))]
pub async fn close(&self) -> Result<(), Error> {
let connection = Arc::downgrade(&self.connection);

Expand All @@ -1045,7 +1047,7 @@ impl<Exe: Executor> TopicProducer<Exe> {
.sender()
.close_producer(self.id)
.await
.map(|_| ())
.map(drop)
.map_err(Error::Connection)
}
}
Expand Down

0 comments on commit 30fae5c

Please sign in to comment.