Skip to content

Commit

Permalink
Use *const c_char cast instead of *const i8
Browse files Browse the repository at this point in the history
  • Loading branch information
gferon authored and filmil committed Oct 17, 2023
1 parent ea9a0d9 commit 96c98e9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions rust_icu_ucsdet/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ use {
ffi::CStr,
marker::PhantomData,
mem::transmute,
os::raw::c_char,
ptr::{self, NonNull},
},
};
Expand Down Expand Up @@ -87,7 +88,7 @@ impl<'detector> CharsetDetector<'detector> {
unsafe {
versioned_function!(ucsdet_setText)(
self.rep.as_ptr(),
text.as_ptr() as *const i8,
text.as_ptr() as *const c_char,
text.len() as i32,
&mut status,
);
Expand All @@ -101,7 +102,7 @@ impl<'detector> CharsetDetector<'detector> {
unsafe {
versioned_function!(ucsdet_setDeclaredEncoding)(
self.rep.as_ptr(),
encoding.as_ptr() as *const i8,
encoding.as_ptr() as *const c_char,
encoding.len() as i32,
&mut status,
);
Expand Down

0 comments on commit 96c98e9

Please sign in to comment.