rename deprecated utf16_units to encode_utf16

This commit is contained in:
Arpad Borsos 2016-03-07 16:10:42 +01:00
parent 743e0c9c87
commit c880c97b1b
7 changed files with 8 additions and 10 deletions

View file

@ -10,7 +10,6 @@
#![feature(iter_arith)]
#![feature(link_args)]
#![feature(plugin)]
#![feature(str_utf16)]
#![feature(unicode)]
#![feature(unsafe_no_drop_flag)]

View file

@ -124,7 +124,7 @@ pub extern "C" fn cef_string_utf8_cmp(a: *const cef_string_utf8_t, b: *const cef
#[no_mangle]
pub extern "C" fn cef_string_utf8_to_utf16(src: *const u8, src_len: size_t, output: *mut cef_string_utf16_t) -> c_int {
slice_to_str(src, src_len as usize, |result| {
let conv = result.utf16_units().collect::<Vec<u16>>();
let conv = result.encode_utf16().collect::<Vec<u16>>();
cef_string_utf16_set(conv.as_ptr(), conv.len() as size_t, output, 1);
1
})
@ -286,7 +286,7 @@ pub extern "C" fn cef_string_wide_to_utf8(src: *const wchar_t, src_len: size_t,
#[no_mangle]
pub extern "C" fn cef_string_ascii_to_utf16(src: *const u8, src_len: size_t, output: *mut cef_string_utf16_t) -> c_int {
slice_to_str(src, src_len as usize, |result| {
let conv = result.utf16_units().collect::<Vec<u16>>();
let conv = result.encode_utf16().collect::<Vec<u16>>();
cef_string_utf16_set(conv.as_ptr(), conv.len() as size_t, output, 1)
})
}