diff --git a/citro3d/src/attrib.rs b/citro3d/src/attrib.rs index 67a75e1..ea1f76a 100644 --- a/citro3d/src/attrib.rs +++ b/citro3d/src/attrib.rs @@ -32,8 +32,8 @@ pub enum Format { unsafe impl Sync for Info {} unsafe impl Send for Info {} -impl Info { - pub fn new() -> Self { +impl Default for Info { + fn default() -> Self { let mut raw = MaybeUninit::zeroed(); let raw = unsafe { citro3d_sys::AttrInfo_Init(raw.as_mut_ptr()); @@ -41,6 +41,12 @@ impl Info { }; Self(raw) } +} + +impl Info { + pub fn new() -> Self { + Self::default() + } pub(crate) fn copy_from(raw: *const citro3d_sys::C3D_AttrInfo) -> Option { if raw.is_null() { diff --git a/citro3d/src/buffer.rs b/citro3d/src/buffer.rs index 86e0600..3bc0b66 100644 --- a/citro3d/src/buffer.rs +++ b/citro3d/src/buffer.rs @@ -38,8 +38,8 @@ pub enum Primitive { GeometryPrim = ctru_sys::GPU_GEOMETRY_PRIM, } -impl Info { - pub fn new() -> Self { +impl Default for Info { + fn default() -> Self { let mut info = MaybeUninit::zeroed(); let info = unsafe { citro3d_sys::BufInfo_Init(info.as_mut_ptr()); @@ -47,6 +47,12 @@ impl Info { }; Self(info) } +} + +impl Info { + pub fn new() -> Self { + Self::default() + } pub(crate) fn copy_from(raw: *const citro3d_sys::C3D_BufInfo) -> Option { if raw.is_null() { diff --git a/citro3d/src/lib.rs b/citro3d/src/lib.rs index 0f3f9c0..976b21a 100644 --- a/citro3d/src/lib.rs +++ b/citro3d/src/lib.rs @@ -1,5 +1,3 @@ -#![feature(once_cell)] - //! Safe Rust bindings to `citro3d`. pub mod attrib;