Skip to content

Commit

Permalink
fixup! Fix panic in GroupInfo::members
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremija committed May 6, 2024
1 parent daa10d3 commit 531e6d2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ impl<'a> Message for BorrowedMessage<'a> {

fn topic(&self) -> &str {
unsafe {
CStr::from_ptr(rdsys::rd_kafka_topic_name((self.ptr).rkt))
CStr::from_ptr(rdsys::rd_kafka_topic_name(self.ptr.rkt))
.to_str()
.expect("Topic name is not valid UTF-8")
}
Expand Down
4 changes: 2 additions & 2 deletions src/topic_partition_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ impl TopicPartitionList {

/// Returns all the elements of the list.
pub fn elements(&self) -> Vec<TopicPartitionListElem<'_>> {
let slice = unsafe { util::ptr_to_slice_mut((self.ptr).elems, self.count()) };
let slice = unsafe { util::ptr_to_slice_mut(self.ptr.elems, self.count()) };
let mut vec = Vec::with_capacity(slice.len());
for elem_ptr in slice {
vec.push(TopicPartitionListElem::from_ptr(self, &mut *elem_ptr));
Expand All @@ -337,7 +337,7 @@ impl TopicPartitionList {

/// Returns all the elements of the list that belong to the specified topic.
pub fn elements_for_topic<'a>(&'a self, topic: &str) -> Vec<TopicPartitionListElem<'a>> {
let slice = unsafe { util::ptr_to_slice_mut((self.ptr).elems, self.count()) };
let slice = unsafe { util::ptr_to_slice_mut(self.ptr.elems, self.count()) };
let mut vec = Vec::with_capacity(slice.len());
for elem_ptr in slice {
let tp = TopicPartitionListElem::from_ptr(self, &mut *elem_ptr);
Expand Down

0 comments on commit 531e6d2

Please sign in to comment.