Change CFMutableAttributedString::set_attribute argument type

This commit is contained in:
brunohgouveia
2020-04-17 20:33:05 +01:00
parent 1865cb8861
commit b68e9c782a
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -70,7 +70,7 @@ impl CFMutableAttributedString {
}
#[inline]
pub fn set_attribute<T: TCFType>(&mut self, range: CFRange, name: CFStringRef, value: T) {
pub fn set_attribute<T: TCFType>(&mut self, range: CFRange, name: CFStringRef, value: &T) {
unsafe {
CFAttributedStringSetAttribute(
self.0, range, name, value.as_CFTypeRef());
+1 -1
View File
@@ -114,7 +114,7 @@ fn create_runs() {
string.replace_str(&CFString::new("Food"), CFRange::init(0, 0));
let len = string.char_len();
unsafe {
string.set_attribute(CFRange::init(0, len), kCTFontAttributeName, font::new_from_name("Helvetica", 16.).unwrap());
string.set_attribute(CFRange::init(0, len), kCTFontAttributeName, &font::new_from_name("Helvetica", 16.).unwrap());
}
let line = CTLine::new_with_attributed_string(string.as_concrete_TypeRef());
let runs = line.glyph_runs();