diff options
Diffstat (limited to 'font/src/ft/fc/pattern.rs')
-rw-r--r-- | font/src/ft/fc/pattern.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/font/src/ft/fc/pattern.rs b/font/src/ft/fc/pattern.rs index 84187aa3..b6eceed8 100644 --- a/font/src/ft/fc/pattern.rs +++ b/font/src/ft/fc/pattern.rs @@ -15,7 +15,7 @@ use std::ffi::{CStr, CString}; use std::fmt; use std::mem; use std::path::PathBuf; -use std::ptr; +use std::ptr::{self, NonNull}; use std::str; use foreign_types::{ForeignType, ForeignTypeRef}; @@ -326,10 +326,10 @@ impl_derived_property_iter! { } foreign_type! { - type CType = FcPattern; - fn drop = FcPatternDestroy; - pub struct Pattern; - pub struct PatternRef; + pub type Pattern { + type CType = FcPattern; + fn drop = FcPatternDestroy; + } } macro_rules! string_accessor { @@ -360,7 +360,7 @@ impl Pattern { impl Default for Pattern { fn default() -> Self { - Pattern(unsafe { FcPatternCreate() }) + Pattern(unsafe { NonNull::new(FcPatternCreate()).unwrap() }) } } |