diff --git a/src/base.rs b/src/base.rs index 0ea9795..6c7c33d 100644 --- a/src/base.rs +++ b/src/base.rs @@ -10,6 +10,7 @@ // this file defines CGFloat, as well as stubbed data types. #![allow(non_camel_case_types)] +#![allow(non_upper_case_globals)] use libc; diff --git a/src/color_space.rs b/src/color_space.rs index 1947707..10a728a 100644 --- a/src/color_space.rs +++ b/src/color_space.rs @@ -8,12 +8,10 @@ // except according to those terms. use core_foundation::base::{CFRelease, CFRetain, CFTypeID, CFTypeRef, TCFType}; -use libc::{c_void, size_t}; use std::mem; -use std::ptr; #[repr(C)] -struct __CGColorSpace; +pub struct __CGColorSpace; pub type CGColorSpaceRef = *const __CGColorSpace; diff --git a/src/context.rs b/src/context.rs index c37fe2a..52987c0 100644 --- a/src/context.rs +++ b/src/context.rs @@ -16,7 +16,7 @@ use std::ptr; use std::slice; #[repr(C)] -struct __CGContext; +pub struct __CGContext; pub type CGContextRef = *const __CGContext; diff --git a/src/data_provider.rs b/src/data_provider.rs index bb2fdba..fe449a2 100644 --- a/src/data_provider.rs +++ b/src/data_provider.rs @@ -26,7 +26,7 @@ pub type CGDataProviderReleaseDataCallback = *const u8; pub type CGDataProviderGetBytesAtPositionCallback = *const u8; #[repr(C)] -struct __CGDataProvider; +pub struct __CGDataProvider; pub type CGDataProviderRef = *const __CGDataProvider; diff --git a/src/display.rs b/src/display.rs index 69d13cb..491e277 100644 --- a/src/display.rs +++ b/src/display.rs @@ -7,11 +7,11 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// this file defines CGFloat, as well as stubbed data types. -extern crate core_foundation; -// extern crate core_foundation_sys; +#![allow(non_upper_case_globals)] -pub use libc; +extern crate core_foundation; + +use libc; pub use base::{CGError, boolean_t}; pub use geometry::{CGRect, CGPoint, CGSize}; diff --git a/src/font.rs b/src/font.rs index 0ed20c5..e3e2700 100644 --- a/src/font.rs +++ b/src/font.rs @@ -20,7 +20,7 @@ use std::ptr; pub type CGGlyph = libc::c_ushort; #[repr(C)] -struct __CGFont; +pub struct __CGFont; pub type CGFontRef = *const __CGFont; @@ -41,7 +41,7 @@ impl Serialize for CGFont { impl Deserialize for CGFont { fn deserialize(deserializer: &mut D) -> Result where D: Deserializer { let postscript_name: String = try!(Deserialize::deserialize(deserializer)); - CGFont::from_name(&CFString::new(&*postscript_name)).map_err(|err| { + CGFont::from_name(&CFString::new(&*postscript_name)).map_err(|_| { de::Error::invalid_value("Couldn't find a font with that PostScript name!") }) } diff --git a/src/private.rs b/src/private.rs index 518c55c..11231a9 100644 --- a/src/private.rs +++ b/src/private.rs @@ -91,7 +91,7 @@ mod ffi { use libc::{c_int, c_uint}; // This is an enum so that we can't easily make instances of this opaque type. - enum CGSRegionObject {} + pub enum CGSRegionObject {} pub type CGError = OSStatus; pub type CGSRegionRef = *mut CGSRegionObject;