From b68e9c782af87534d50596d7c2a7b965e067eaef Mon Sep 17 00:00:00 2001 From: brunohgouveia Date: Fri, 17 Apr 2020 20:33:05 +0100 Subject: [PATCH] Change CFMutableAttributedString::set_attribute argument type --- core-foundation/src/attributed_string.rs | 2 +- core-text/src/run.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core-foundation/src/attributed_string.rs b/core-foundation/src/attributed_string.rs index c99775d..d4a4679 100644 --- a/core-foundation/src/attributed_string.rs +++ b/core-foundation/src/attributed_string.rs @@ -70,7 +70,7 @@ impl CFMutableAttributedString { } #[inline] - pub fn set_attribute(&mut self, range: CFRange, name: CFStringRef, value: T) { + pub fn set_attribute(&mut self, range: CFRange, name: CFStringRef, value: &T) { unsafe { CFAttributedStringSetAttribute( self.0, range, name, value.as_CFTypeRef()); diff --git a/core-text/src/run.rs b/core-text/src/run.rs index 4dc3226..b7cb376 100644 --- a/core-text/src/run.rs +++ b/core-text/src/run.rs @@ -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();