mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +01:00
Remove some as_slice calls in cef.
This commit is contained in:
parent
1e45d025b3
commit
066cf8e706
2 changed files with 3 additions and 3 deletions
|
@ -61,9 +61,9 @@ pub extern "C" fn command_line_get_switch_value(cmd: *mut cef_command_line_t, na
|
||||||
let opt = String::from_utf16(slice).unwrap();
|
let opt = String::from_utf16(slice).unwrap();
|
||||||
//debug!("opt: {}", opt);
|
//debug!("opt: {}", opt);
|
||||||
for s in (*cl).argv.iter() {
|
for s in (*cl).argv.iter() {
|
||||||
let o = s.as_slice().trim_left_matches('-');
|
let o = s.trim_left_matches('-');
|
||||||
//debug!("arg: {}", o);
|
//debug!("arg: {}", o);
|
||||||
if o.as_slice().starts_with(opt.as_slice()) {
|
if o.starts_with(&opt) {
|
||||||
let mut string = mem::uninitialized();
|
let mut string = mem::uninitialized();
|
||||||
let arg = o[opt.len() + 1..].as_bytes();
|
let arg = o[opt.len() + 1..].as_bytes();
|
||||||
let c_str = ffi::CString::new(arg).unwrap();
|
let c_str = ffi::CString::new(arg).unwrap();
|
||||||
|
|
|
@ -279,7 +279,7 @@ impl WindowMethods for Window {
|
||||||
None => visitor.visit(&[]),
|
None => visitor.visit(&[]),
|
||||||
Some(string) => {
|
Some(string) => {
|
||||||
let utf16_chars: Vec<u16> = Utf16Encoder::new(string.chars()).collect();
|
let utf16_chars: Vec<u16> = Utf16Encoder::new(string.chars()).collect();
|
||||||
visitor.visit(utf16_chars.as_slice())
|
visitor.visit(&utf16_chars)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue