mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +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 = FcConfigGetFonts(config, FcSetSystem);
|
||||||
let font_set_array_ptr = ptr::to_unsafe_ptr(&font_set);
|
let font_set_array_ptr = ptr::to_unsafe_ptr(&font_set);
|
||||||
unsafe {
|
unsafe {
|
||||||
do str::as_c_str("family") |FC_FAMILY| {
|
|
||||||
do str::as_c_str(family.family_name) |family_name| {
|
|
||||||
let pattern = FcPatternCreate();
|
let pattern = FcPatternCreate();
|
||||||
assert!(pattern.is_not_null());
|
assert!(pattern.is_not_null());
|
||||||
let family_name = family_name as *FcChar8;
|
do str::as_c_str("family") |FC_FAMILY| {
|
||||||
let ok = FcPatternAddString(pattern, FC_FAMILY, family_name);
|
do str::as_c_str(family.family_name) |family_name| {
|
||||||
|
let ok = FcPatternAddString(pattern, FC_FAMILY, family_name as *FcChar8);
|
||||||
assert!(ok != 0);
|
assert!(ok != 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let object_set = FcObjectSetCreate();
|
let object_set = FcObjectSetCreate();
|
||||||
assert!(object_set.is_not_null());
|
assert!(object_set.is_not_null());
|
||||||
|
|
||||||
str::as_c_str("file", |FC_FILE| FcObjectSetAdd(object_set, FC_FILE) );
|
do str::as_c_str("file") |FC_FILE| {
|
||||||
str::as_c_str("index", |FC_INDEX| FcObjectSetAdd(object_set, FC_INDEX) );
|
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);
|
let matches = FcFontSetList(config, font_set_array_ptr, 1, pattern, object_set);
|
||||||
|
|
||||||
|
@ -120,8 +125,6 @@ pub impl FontListHandle {
|
||||||
FcObjectSetDestroy(object_set);
|
FcObjectSetDestroy(object_set);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn path_from_identifier(name: ~str, style: &UsedFontStyle) -> Result<~str, ()> {
|
pub fn path_from_identifier(name: ~str, style: &UsedFontStyle) -> Result<~str, ()> {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue