mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35:33 +01:00
Remove usage of unstable rustc_unicode crate.
This commit is contained in:
parent
56f236724c
commit
17a183808e
4 changed files with 6 additions and 18 deletions
|
@ -6,7 +6,6 @@
|
|||
#![feature(core_intrinsics)]
|
||||
#![feature(link_args)]
|
||||
#![feature(plugin)]
|
||||
#![feature(unicode)]
|
||||
|
||||
#![allow(non_camel_case_types)]
|
||||
|
||||
|
@ -22,7 +21,6 @@ extern crate euclid;
|
|||
extern crate gfx_traits;
|
||||
extern crate gleam;
|
||||
extern crate glutin_app;
|
||||
extern crate rustc_unicode;
|
||||
extern crate script_traits;
|
||||
extern crate servo_config;
|
||||
extern crate servo_geometry;
|
||||
|
|
|
@ -7,8 +7,6 @@ use std::slice;
|
|||
use string::cef_string_utf16_set;
|
||||
use types::{cef_string_list_t,cef_string_t};
|
||||
|
||||
use rustc_unicode::str::Utf16Encoder;
|
||||
|
||||
//cef_string_list
|
||||
|
||||
#[no_mangle]
|
||||
|
@ -38,7 +36,7 @@ pub extern "C" fn cef_string_list_value(lt: *mut cef_string_list_t, index: c_int
|
|||
if index < 0 || lt.is_null() { return 0; }
|
||||
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();
|
||||
let utf16_chars: Vec<u16> = string.encode_utf16().collect();
|
||||
cef_string_utf16_set(utf16_chars.as_ptr(), utf16_chars.len(), value, 1)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,7 +14,6 @@ use eutil::Downcast;
|
|||
use interfaces::CefApp;
|
||||
use interfaces::CefBrowser;
|
||||
use render_handler::CefRenderHandlerExtensions;
|
||||
use rustc_unicode::str::Utf16Encoder;
|
||||
use types::{cef_cursor_handle_t, cef_cursor_type_t, cef_rect_t};
|
||||
use wrappers::CefWrap;
|
||||
|
||||
|
@ -331,10 +330,7 @@ impl WindowMethods for Window {
|
|||
Some(ref browser) => browser,
|
||||
};
|
||||
let str = match info {
|
||||
Some(s) => {
|
||||
let utf16_chars: Vec<u16> = Utf16Encoder::new(s.chars()).collect();
|
||||
utf16_chars
|
||||
}
|
||||
Some(s) => s.encode_utf16().collect::<Vec<u16>>(),
|
||||
None => vec![]
|
||||
};
|
||||
|
||||
|
@ -397,7 +393,7 @@ impl WindowMethods for Window {
|
|||
};
|
||||
if check_ptr_exist!(browser.get_host().get_client(), get_load_handler) &&
|
||||
check_ptr_exist!(browser.get_host().get_client().get_load_handler(), on_load_error) {
|
||||
let utf16_chars: Vec<u16> = Utf16Encoder::new((url).chars()).collect();
|
||||
let utf16_chars: Vec<u16> = url.encode_utf16().collect();
|
||||
browser.get_host()
|
||||
.get_client()
|
||||
.get_load_handler()
|
||||
|
@ -428,10 +424,7 @@ impl WindowMethods for Window {
|
|||
let frame = frame.downcast();
|
||||
let mut title_visitor = frame.title_visitor.borrow_mut();
|
||||
let str = match string {
|
||||
Some(s) => {
|
||||
let utf16_chars: Vec<u16> = Utf16Encoder::new(s.chars()).collect();
|
||||
utf16_chars
|
||||
}
|
||||
Some(s) => s.encode_utf16().collect(),
|
||||
None => vec![]
|
||||
};
|
||||
|
||||
|
@ -461,7 +454,7 @@ impl WindowMethods for Window {
|
|||
// FIXME(https://github.com/rust-lang/rust/issues/23338)
|
||||
let mut frame_url = servoframe.url.borrow_mut();
|
||||
*frame_url = url.into_string();
|
||||
let utf16_chars: Vec<u16> = Utf16Encoder::new((*frame_url).chars()).collect();
|
||||
let utf16_chars: Vec<u16> = frame_url.encode_utf16().collect();
|
||||
if check_ptr_exist!(browser.get_host().get_client(), get_display_handler) &&
|
||||
check_ptr_exist!(browser.get_host().get_client().get_display_handler(), on_address_change) {
|
||||
browser.get_host().get_client().get_display_handler().on_address_change((*browser).clone(), frame.clone(), utf16_chars.as_slice());
|
||||
|
|
|
@ -8,7 +8,6 @@ use interfaces::{cef_dialog_handler_t, cef_focus_handler_t};
|
|||
use interfaces::{cef_download_handler_t, cef_drag_handler_t, cef_context_menu_handler_t};
|
||||
use interfaces::{cef_geolocation_handler_t, cef_jsdialog_handler_t, cef_keyboard_handler_t};
|
||||
use interfaces::{cef_load_handler_t, cef_request_handler_t};
|
||||
use rustc_unicode::str::Utf16Encoder;
|
||||
use types::{cef_base_t, cef_browser_settings_t, CefBrowserSettings, cef_color_model_t};
|
||||
use types::{cef_context_menu_edit_state_flags_t};
|
||||
use types::{cef_context_menu_media_state_flags_t};
|
||||
|
@ -255,7 +254,7 @@ impl<'a,'b> CefWrap<*mut *const c_char> for &'a mut &'b str {
|
|||
|
||||
impl<'a> CefWrap<cef_string_userfree_t> for String {
|
||||
fn to_c(string: String) -> cef_string_userfree_t {
|
||||
let utf16_chars: Vec<u16> = Utf16Encoder::new(string.chars()).collect();
|
||||
let utf16_chars: Vec<u16> = string.encode_utf16().collect();
|
||||
|
||||
let boxed_string;
|
||||
unsafe {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue