mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
embedding: replace transmutes with manual casts in cef_string_utf8_cmp()
This commit is contained in:
parent
852bfdd859
commit
3d0d004887
1 changed files with 2 additions and 2 deletions
|
@ -96,8 +96,8 @@ pub extern "C" fn cef_string_utf8_set(src: *const u8, src_len: size_t, output: *
|
|||
#[no_mangle]
|
||||
pub extern "C" fn cef_string_utf8_cmp(a: *const cef_string_utf8_t, b: *const cef_string_utf8_t) -> c_int {
|
||||
unsafe {
|
||||
slice::raw::buf_as_slice(mem::transmute((*a).str), (*a).length as uint, |astr:&[u8]| {
|
||||
slice::raw::buf_as_slice(mem::transmute((*b).str), (*b).length as uint, |bstr:&[u8]| {
|
||||
slice::raw::buf_as_slice((*a).str as *const u8, (*a).length as uint, |astr:&[u8]| {
|
||||
slice::raw::buf_as_slice((*b).str as *const u8, (*b).length as uint, |bstr:&[u8]| {
|
||||
match astr.cmp(&bstr) {
|
||||
Less => -1,
|
||||
Equal => 0,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue