File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change 11//! Store and manipulate Kafka messages.
22
3- use std:: ffi:: { CStr , CString } ;
3+ use std:: ffi:: CStr ;
44use std:: fmt;
55use std:: marker:: PhantomData ;
6- use std:: os:: raw:: c_void;
6+ use std:: os:: raw:: { c_char , c_void} ;
77use std:: ptr;
88use std:: str;
99use std:: sync:: Arc ;
@@ -534,7 +534,6 @@ impl OwnedHeaders {
534534 where
535535 V : ToBytes + ?Sized ,
536536 {
537- let name_cstring = CString :: new ( header. key ) . unwrap ( ) ;
538537 let ( value_ptr, value_len) = match header. value {
539538 None => ( ptr:: null_mut ( ) , 0 ) ,
540539 Some ( value) => {
@@ -548,8 +547,8 @@ impl OwnedHeaders {
548547 let err = unsafe {
549548 rdsys:: rd_kafka_header_add (
550549 self . ptr ( ) ,
551- name_cstring . as_ptr ( ) ,
552- name_cstring . as_bytes ( ) . len ( ) as isize ,
550+ header . key . as_ptr ( ) as * const c_char ,
551+ header . key . as_bytes ( ) . len ( ) as isize ,
553552 value_ptr,
554553 value_len,
555554 )
You can’t perform that action at this time.
0 commit comments