Browse Source

Fix up a few remaining clippy errors

pull/16/head
Ian Chamberlain 2 years ago
parent
commit
b05a1e3ff3
No known key found for this signature in database
GPG Key ID: AE5484D09405AA60
  1. 10
      citro3d/src/attrib.rs
  2. 10
      citro3d/src/buffer.rs
  3. 2
      citro3d/src/lib.rs

10
citro3d/src/attrib.rs

@ -32,8 +32,8 @@ pub enum Format { @@ -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 { @@ -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<Self> {
if raw.is_null() {

10
citro3d/src/buffer.rs

@ -38,8 +38,8 @@ pub enum Primitive { @@ -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 { @@ -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<Self> {
if raw.is_null() {

2
citro3d/src/lib.rs

@ -1,5 +1,3 @@ @@ -1,5 +1,3 @@
#![feature(once_cell)]
//! Safe Rust bindings to `citro3d`.
pub mod attrib;

Loading…
Cancel
Save