diff options
Diffstat (limited to 'font/src/ft/fc/object_set.rs')
-rw-r--r-- | font/src/ft/fc/object_set.rs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/font/src/ft/fc/object_set.rs b/font/src/ft/fc/object_set.rs index 2494b582..4ec15feb 100644 --- a/font/src/ft/fc/object_set.rs +++ b/font/src/ft/fc/object_set.rs @@ -11,16 +11,18 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +use std::ptr::NonNull; + use libc::c_char; use super::ffi::{FcObjectSet, FcObjectSetAdd, FcObjectSetCreate, FcObjectSetDestroy}; use foreign_types::ForeignTypeRef; foreign_type! { - type CType = FcObjectSet; - fn drop = FcObjectSetDestroy; - pub struct ObjectSet; - pub struct ObjectSetRef; + pub type ObjectSet { + type CType = FcObjectSet; + fn drop = FcObjectSetDestroy; + } } impl ObjectSet { @@ -31,7 +33,7 @@ impl ObjectSet { impl Default for ObjectSet { fn default() -> Self { - ObjectSet(unsafe { FcObjectSetCreate() }) + ObjectSet(unsafe { NonNull::new(FcObjectSetCreate()).unwrap() }) } } |