From f53aaa1cdc5b210d5390be71b92e7c8cc51ac8d2 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Thu, 7 Feb 2013 12:20:20 -0800 Subject: [PATCH] Update for language changes --- data_provider.rs | 7 ++++++- font.rs | 9 +++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/data_provider.rs b/data_provider.rs index d4268e9..394ab9e 100644 --- a/data_provider.rs +++ b/data_provider.rs @@ -19,7 +19,12 @@ pub type CGDataProviderRef = *__CGDataProvider; pub impl CGDataProviderRef : AbstractCFTypeRef { pure fn as_type_ref(&self) -> CFTypeRef { *self as CFTypeRef } - static pure fn type_id() -> CFTypeID { unsafe { CGDataProviderGetTypeID() } } + + static pure fn type_id() -> CFTypeID { + unsafe { + CGDataProviderGetTypeID() + } + } } pub type CGDataProvider = CFWrapper; diff --git a/font.rs b/font.rs index 5f504d5..bc8b948 100644 --- a/font.rs +++ b/font.rs @@ -11,14 +11,19 @@ pub type CGFontRef = *__CGFont; pub impl CGFontRef : AbstractCFTypeRef { pure fn as_type_ref(&self) -> CFTypeRef { *self as CFTypeRef } - static pure fn type_id() -> CFTypeID { unsafe { CGFontGetTypeID() } } + + static pure fn type_id() -> CFTypeID { + unsafe { + CGFontGetTypeID() + } + } } pub type CGFont = CFWrapper; pub fn create_with_data_provider(provider: &CGDataProvider) -> CGFont { + // TODO: error handling unsafe { - // TODO: error handling let value = CGFontCreateWithDataProvider(*provider.borrow_ref()); CFWrapper::wrap_owned(value) }