Remove some as_slice calls in cef.

This commit is contained in:
Ms2ger 2015-04-13 14:58:32 +02:00
parent 1e45d025b3
commit 066cf8e706
2 changed files with 3 additions and 3 deletions

View file

@ -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();

View file

@ -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)
} }
} }
} }