From 96c98e92bf331e482c5cc702f6dccc09f043523f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20F=C3=A9ron?= Date: Tue, 17 Oct 2023 13:33:19 +0200 Subject: [PATCH] Use *const c_char cast instead of *const i8 --- rust_icu_ucsdet/src/lib.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rust_icu_ucsdet/src/lib.rs b/rust_icu_ucsdet/src/lib.rs index dc2c2c6a..eebdc8e7 100644 --- a/rust_icu_ucsdet/src/lib.rs +++ b/rust_icu_ucsdet/src/lib.rs @@ -37,6 +37,7 @@ use { ffi::CStr, marker::PhantomData, mem::transmute, + os::raw::c_char, ptr::{self, NonNull}, }, }; @@ -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, ); @@ -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, );