mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Remove unnecessary transmute in cef_string_list_value.
This commit is contained in:
parent
4a7c5c8042
commit
2c032edc16
1 changed files with 1 additions and 2 deletions
|
@ -4,7 +4,6 @@
|
|||
|
||||
use libc::{c_int};
|
||||
use std::boxed;
|
||||
use std::mem;
|
||||
use std::slice;
|
||||
use string::cef_string_utf16_set;
|
||||
use types::{cef_string_list_t,cef_string_t};
|
||||
|
@ -41,7 +40,7 @@ pub extern "C" fn cef_string_list_value(lt: *mut cef_string_list_t, index: c_int
|
|||
if index as usize > (*lt).len() - 1 { return 0; }
|
||||
let ref string = (*lt)[index as usize];
|
||||
let utf16_chars: Vec<u16> = Utf16Encoder::new(string.chars()).collect();
|
||||
cef_string_utf16_set(mem::transmute(utf16_chars.as_ptr()), utf16_chars.len() as u64, value, 1)
|
||||
cef_string_utf16_set(utf16_chars.as_ptr(), utf16_chars.len() as u64, value, 1)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue