diff options
Diffstat (limited to 'font/src/ft/fc/font_set.rs')
-rw-r--r-- | font/src/ft/fc/font_set.rs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/font/src/ft/fc/font_set.rs b/font/src/ft/fc/font_set.rs index aeb34371..e280201b 100644 --- a/font/src/ft/fc/font_set.rs +++ b/font/src/ft/fc/font_set.rs @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. use std::ops::Deref; +use std::ptr::NonNull; use foreign_types::{ForeignType, ForeignTypeRef}; @@ -20,12 +21,10 @@ use super::{ConfigRef, ObjectSetRef, PatternRef}; use super::ffi::{FcFontSet, FcFontSetDestroy, FcFontSetList}; foreign_type! { - type CType = FcFontSet; - fn drop = FcFontSetDestroy; - /// Wraps an FcFontSet instance (owned) - pub struct FontSet; - /// Wraps an FcFontSet reference (borrowed) - pub struct FontSetRef; + pub type FontSet { + type CType = FcFontSet; + fn drop = FcFontSetDestroy; + } } impl FontSet { @@ -44,7 +43,7 @@ impl FontSet { objects.as_ptr(), ) }; - FontSet(raw) + FontSet(NonNull::new(raw).unwrap()) } } |