mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Merge pull request #454 from metajack/dynamic-borrow-errors
Fix dynamic borrow check errors.
This commit is contained in:
commit
41099c07a8
1 changed files with 52 additions and 49 deletions
|
@ -66,19 +66,24 @@ pub impl FontListHandle {
|
|||
let font_set = FcConfigGetFonts(config, FcSetSystem);
|
||||
let font_set_array_ptr = ptr::to_unsafe_ptr(&font_set);
|
||||
unsafe {
|
||||
do str::as_c_str("family") |FC_FAMILY| {
|
||||
do str::as_c_str(family.family_name) |family_name| {
|
||||
let pattern = FcPatternCreate();
|
||||
assert!(pattern.is_not_null());
|
||||
let family_name = family_name as *FcChar8;
|
||||
let ok = FcPatternAddString(pattern, FC_FAMILY, family_name);
|
||||
do str::as_c_str("family") |FC_FAMILY| {
|
||||
do str::as_c_str(family.family_name) |family_name| {
|
||||
let ok = FcPatternAddString(pattern, FC_FAMILY, family_name as *FcChar8);
|
||||
assert!(ok != 0);
|
||||
}
|
||||
}
|
||||
|
||||
let object_set = FcObjectSetCreate();
|
||||
assert!(object_set.is_not_null());
|
||||
|
||||
str::as_c_str("file", |FC_FILE| FcObjectSetAdd(object_set, FC_FILE) );
|
||||
str::as_c_str("index", |FC_INDEX| FcObjectSetAdd(object_set, FC_INDEX) );
|
||||
do str::as_c_str("file") |FC_FILE| {
|
||||
FcObjectSetAdd(object_set, FC_FILE);
|
||||
}
|
||||
do str::as_c_str("index") |FC_INDEX| {
|
||||
FcObjectSetAdd(object_set, FC_INDEX);
|
||||
}
|
||||
|
||||
let matches = FcFontSetList(config, font_set_array_ptr, 1, pattern, object_set);
|
||||
|
||||
|
@ -121,8 +126,6 @@ pub impl FontListHandle {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn path_from_identifier(name: ~str, style: &UsedFontStyle) -> Result<~str, ()> {
|
||||
unsafe {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue