Skip to content

Commit

Permalink
Change Request::respond to borrow self
Browse files Browse the repository at this point in the history
This will allow for anticipated request with multiple responses pattern.
  • Loading branch information
jlandahl authored Nov 15, 2023
1 parent be614fe commit c661d21
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion async-nats/src/service/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,7 @@ impl Request {
/// # Ok(())
/// # }
/// ```
pub async fn respond(self, response: Result<Bytes, error::Error>) -> Result<(), PublishError> {
pub async fn respond(&self, response: Result<Bytes, error::Error>) -> Result<(), PublishError> {
let reply = self.message.reply.clone().unwrap();
let result = match response {
Ok(payload) => self.client.publish(reply, payload).await,
Expand Down

0 comments on commit c661d21

Please sign in to comment.