From 652b5cbd43da7d023d22576ab599a9e416f48ffa Mon Sep 17 00:00:00 2001 From: Ivan Chan Date: Wed, 15 Mar 2023 22:34:51 +0000 Subject: [PATCH] Fix exclusive_publication by not cloning BufferClaim --- src/exclusive_publication.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/exclusive_publication.rs b/src/exclusive_publication.rs index f71793c..bc1872c 100644 --- a/src/exclusive_publication.rs +++ b/src/exclusive_publication.rs @@ -490,7 +490,7 @@ impl ExclusivePublication { * @see BufferClaim::commit * @see BufferClaim::abort */ - pub fn try_claim(&mut self, length: Index, mut buffer_claim: BufferClaim) -> Result { + pub fn try_claim(&mut self, length: Index, buffer_claim: &mut BufferClaim) -> Result { self.check_payload_length(length)?; if !self.is_closed() { @@ -500,7 +500,7 @@ impl ExclusivePublication { if position < limit { let resulting_offset = - term_appender.claim(self.term_id, self.term_offset, &self.header_writer, length, &mut buffer_claim); + term_appender.claim(self.term_id, self.term_offset, &self.header_writer, length, buffer_claim); Ok(self.new_position(resulting_offset)?) } else { Err(self.back_pressure_status(position, length))