diff options
Diffstat (limited to 'font/src/ft/fc/char_set.rs')
-rw-r--r-- | font/src/ft/fc/char_set.rs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/font/src/ft/fc/char_set.rs b/font/src/ft/fc/char_set.rs index 310fa189..9d71fea4 100644 --- a/font/src/ft/fc/char_set.rs +++ b/font/src/ft/fc/char_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 foreign_types::ForeignTypeRef; use super::ffi::FcCharSetCreate; use super::ffi::{FcCharSet, FcCharSetAddChar, FcCharSetDestroy}; foreign_type! { - type CType = FcCharSet; - fn drop = FcCharSetDestroy; - pub struct CharSet; - pub struct CharSetRef; + pub type CharSet { + type CType = FcCharSet; + fn drop = FcCharSetDestroy; + } } impl CharSet { @@ -31,7 +33,7 @@ impl CharSet { impl Default for CharSet { fn default() -> Self { - CharSet(unsafe { FcCharSetCreate() }) + CharSet(unsafe { NonNull::new(FcCharSetCreate()).unwrap() }) } } |