embedding: address most recent critic review

This commit is contained in:
Mike Blumenkrantz 2014-11-13 15:07:41 -05:00
parent 19c80b1741
commit 2d4c6a1d1c
2 changed files with 2 additions and 7 deletions

View file

@ -13,12 +13,7 @@ pub fn fptr_is_null(fptr: *const u8) -> bool {
pub fn slice_to_str(s: *const u8, l: uint, f: |&str| -> c_int) -> c_int {
unsafe {
slice::raw::buf_as_slice(s, l, |result| {
match str::from_utf8(result) {
Some(ruststr) => {
f(ruststr)
},
None => 0
}
str::from_utf8(result).map(|s| f(s)).unwrap_or(0)
})
}
}

View file

@ -7,7 +7,7 @@ use libc::{c_int};
use std::collections::TreeMap;
use std::mem;
use std::string::String;
use string::{cef_string_userfree_utf8_alloc,cef_string_userfree_utf8_free,cef_string_utf8_set};
use string::{cef_string_userfree_utf8_alloc, cef_string_userfree_utf8_free, cef_string_utf8_set};
use types::{cef_string_map_t, cef_string_t};
fn string_map_to_treemap(sm: *mut cef_string_map_t) -> *mut TreeMap<String, *mut cef_string_t> {