summaryrefslogtreecommitdiffstats
path: root/font/src/ft/fc/object_set.rs
diff options
context:
space:
mode:
authorChristian Duerr <chrisduerr@users.noreply.github.com>2019-06-08 16:01:14 +0000
committerGitHub <noreply@github.com>2019-06-08 16:01:14 +0000
commit4cd55acd7820a7358f9175c106c91e0945fb15b2 (patch)
tree9e4e8383e73406524ccb2d28e666e9c2a77bbbd0 /font/src/ft/fc/object_set.rs
parent527dc8f564823d3dd01f79f22614271c7f3bc518 (diff)
Bump minimum supported Rust version to 1.32.0
Diffstat (limited to 'font/src/ft/fc/object_set.rs')
-rw-r--r--font/src/ft/fc/object_set.rs12
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() })
}
}